Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
React Native docs
ActionsReact Native

Toggle group

Group related pressed-state buttons in one frame.

Public APILumenToggleGroupReact Native

Native example

Use Toggle group

Items are independent. Use a segmented control when exactly one option must be chosen.

Toggle group rendered in the Expo web renderer Lumen playground

Captured exampleExpo web renderer

Open interactive preview
Open the Toggle group demo
tsx
import { LumenToggleGroup } from '@santi020k/lumen-react-native'
import { useState } from 'react'

export function TextFormatting() {
  const [formats, setFormats] = useState<string[]>(['italic'])

  return (
    <LumenToggleGroup
      label="Text formatting"
      value={formats}
      onValueChange={setFormats}
      items={[
        { value: 'italic', label: 'Italic', icon: 'italic' },
        { value: 'underline', label: 'Underline', icon: 'underline' },
        { value: 'strikethrough', label: 'Strikethrough', icon: 'strikethrough' }
      ]}
    />
  )
}
React Native
A controlled toolbar of independent text-formatting toggles inside one labelled group.

Reference

Public API

The primary shared and platform-specific options exposed by LumenToggleGroup.

APIValues or typeDefaultDescription
items / value / labelbuttons / pressed values / group namerequired / none pressed / requiredItems are independent.

Native behavior

Design and accessibility

When to use it

Items are independent. Use a segmented control when exactly one option must be chosen.

Accessibility

Named group; each item exposes pressed state.

Shared component

Available on other platforms

Apple / SwiftUIAndroid / Compose Web
React Native docsNative primitives