Welcome UI logo
FOUNDATIONSCOMPONENTSBLOG650+
10.0.1

Menu

    Actions

    • Button
    • ButtonGroup
    • Close Button
    • Link

    Data display

    • Accordion
    • Avatar
    • Badge
    • Card
    • Swiper
    • Table
    • Tag
    • VisuallyHidden

    Feedback

    • Alert
    • StickyNote

      NEW

    • Toast

    Forms

    • Checkbox
    • DatePicker
    • DateTimePicker
    • Field
    • FileDrop
    • FileUpload
    • Hint
    • InputText
    • Label
    • PasswordInput
    • Radio
    • RadioGroup
    • RadioTab
    • Search
    • Select
    • Slider
    • Textarea
    • TimePicker
    • Toggle

    Icons & logo

    • Icon
    • IconStamp

      NEW

    • Logo
    • VariantIcon
    • WelcomeLoader

    Layout

    • AspectRatio
    • Loader
    • Window

      NEW

    Navigation

    • Breadcrumb
    • DropdownMenu
    • Pagination
    • Stepper

      NEW

    • Tabs

    Overlay

    • Drawer
    • Modal
    • Popover
    • Tooltip

    Typography

    • Text

    Utilities

    • Grid background

Overview

Props

Toggle

The Toggle component is an interactive UI element that allows users to switch between two states, such as on/off or enabled/disabled. It is commonly used for settings and preferences where a binary choice is required. This component provides a clear and intuitive way for users to make selections, enhancing usability and interaction within an application.

SourceBuilt with Ariakit
Github
import * as React from 'react'
import { Toggle } from 'welcome-ui/Toggle'
const Example = () => {
const [toggle, setToggle] = React.useState(false)
return (
<Toggle aria-label="Toggle component" checked={toggle} onClick={() => setToggle(!toggle)} />
)
}
export default Example

Examples

Label

Use Field component to add a label

Github

Hint

Use Field component to add a hint

Github

Disabled

Use disabled property to disable the Toggle.

Github

Visibility Icon

Use withVisibilityIcon property to add an eye / eye-slash icon to toggle visibility.

Github

Size

Use size property with option lg, md or sm to set the size of the Toggle.

Github
Time pickerIcon

On this page

  • Definition
  • Examples
    • Label
    • Hint
    • Disabled
    • Visibility Icon
    • Size
Made with by
Welcome to the jungle logo

Documentations

  • Foundations
  • Components
  • Source code

Updates

  • Releases
  • Issues

Community

  • Github
  • Twitter
  • Medium
  • Jobs