(null)
return (
setValue(e.value)}>
{(framework) => (
{framework()}
)}
)
}
```
#### Vue
```vue
{{ framework }}
```
#### Svelte
```svelte
{#each frameworks as framework}
{framework}
{/each}
```
### Root Provider
An alternative way to control the segment group is to use the `RootProvider` component and the `useSegmentGroup` hook.
This way you can access the state and methods from outside the component.
**Example: root-provider**
#### React
```tsx
import { SegmentGroup, useSegmentGroup } from '@ark-ui/react/segment-group'
import styles from 'styles/segment-group.module.css'
export const RootProvider = () => {
const frameworks = ['React', 'Solid', 'Svelte', 'Vue']
const segmentGroup = useSegmentGroup({ defaultValue: 'React' })
return (
{frameworks.map((framework) => (
{framework}
))}
)
}
```
#### Solid
```tsx
import { SegmentGroup, useSegmentGroup } from '@ark-ui/solid/segment-group'
import { Index } from 'solid-js'
import styles from 'styles/segment-group.module.css'
export const RootProvider = () => {
const frameworks = ['React', 'Solid', 'Svelte', 'Vue']
const segmentGroup = useSegmentGroup({ defaultValue: 'React' })
return (
{(framework) => (
{framework()}
)}
)
}
```
#### Vue
```vue
{{ framework }}
```
#### Svelte
```svelte
{#each frameworks as framework}
{framework}
{/each}
```
### Disabled
To disable a segment, simply pass the `disabled` prop to the `SegmentGroup.Item` component:
**Example: disabled**
#### React
```tsx
import { SegmentGroup } from '@ark-ui/react/segment-group'
import styles from 'styles/segment-group.module.css'
export const Disabled = () => {
const frameworks = ['React', 'Solid', 'Svelte', 'Vue']
return (
{frameworks.map((framework) => (
{framework}
))}
)
}
```
#### Solid
```tsx
import { SegmentGroup } from '@ark-ui/solid/segment-group'
import { Index } from 'solid-js'
import styles from 'styles/segment-group.module.css'
export const Disabled = () => {
const frameworks = ['React', 'Solid', 'Svelte', 'Vue']
return (
{(framework) => (
{framework()}
)}
)
}
```
#### Vue
```vue
{{ framework }}
```
#### Svelte
```svelte
{#each frameworks as framework}
{framework}
{/each}
```
## API Reference
## Accessibility
Complies with the [Radio WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/radio/).
### Keyboard Support