Skip to main content

Select

Select dùng popover để hiện các options thay vì mặc định của polaris

  import { Select } from '@xobuilder/ui';
import { OptionDescriptor } from '@shopify/polaris/build/ts/src/types';

const [value, setValue] = useState<string[]>(['1']);

const options: OptionDescriptor[] = [
{ label: 'Thin', value: '100' },
{ label: 'Extra Light', value: '200' },
{ label: 'Light', value: '300' },
{ label: 'Regular', value: '400' },
];

return (
<Select selected={value} onChange={setValue} options={options} />
)