About
Container wrapper providing context (value, onChange, size, isDisabled) to SegmentedControlItem children. Astryx by Meta. Source: https://astryx.atmeta.com/components/SegmentedControl
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Segmented Control to your project and fits it to your theme.
Code
How Astryx Segmented Control is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
'use client';
/* Copyright (c) 2026 Meta Platforms, Inc. See MIT notice in astryx-segmented-control.tsx. */
import '@/components/ui/astryx-segmented-control-utils/astryx-preview.css';
import {useState} from 'react';
import {
SegmentedControl,
SegmentedControlItem,
} from '@/components/ui/astryx-segmented-control';
function OfficialSample() {
const [value, setValue] = useState('grid');
return (
<SegmentedControl value={value} onChange={setValue} label="View mode">
<SegmentedControlItem value="grid" label="Grid" />
<SegmentedControlItem value="list" label="List" />
<SegmentedControlItem value="table" label="Table" />
</SegmentedControl>
);
}
export default function Demo() {
return (
<div className="astryx-demo" data-astryx-theme="neutral" data-theme="light">
<div className="astryx-demo-content" data-centered style={{maxWidth: 325}}>
<OfficialSample />
</div>
</div>
);
}







