halaska-studio

Segmented Control

Component 2

About

An iOS-style segmented control where a sliding thumb animates between options to switch between a small set of views or filters.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Segmented Control to your project and fits it to your theme.

Code

How Segmented Control is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import SegmentedControl from "@/components/ui/segmented-control";
import { useState } from "react";

export default function FullWidthDemo() {
  const [range, setRange] = useState("7 days");
  return (
    <div style={{ width: 360 }}>
      <SegmentedControl
        options={["Today", "7 days", "30 days", "All time"]}
        value={range}
        onChange={setRange}
      />
    </div>
  );
}

More by halaska-studio

View all
  • Dot Grid

    Dot Grid

    24
  • Orb

    Orb

    15
  • Choicebox

    Choicebox

    6
  • Combobox

    Combobox

    5
  • Dialog

    Dialog

    4
  • Input OTP

    Input OTP

    4
  • Table

    Table

    2
  • Switch

    Switch

    1