Skip to content
Frauthy Brand
Frauthy index

Go anywhere.

    No exact contract found. Try a component family, product name, prop, or keyboard key.

    ↑↓ move↵ openesc close

    04 · Actions & collections

    beta

    ToggleButton

    A native button with controlled or uncontrolled pressed state and optional form submission value.

    Since
    1.0.0-next.0
    Owner
    Brand Core
    Export
    PRIVATE_BETA_PACKAGE_COORDINATE_REDACTED/ToggleButton
    Release
    Documentation version
    Deterministic fixture · default state

    Component studio

    light · comfortable · LTR

    Deterministic state: ready · no request is sent

    §01

    Contract

    Semantics first

    Anatomy

    Renders button with aria-pressed; a selected named toggle adds a hidden form value.

    Consumer classes, styles, and data attributes may extend the surface, but required roles, IDs, relationships, and handlers remain owned by the component.

    Keyboard

    • Tab focuses the button.
    • Enter and Space toggle pressed state once.
    • Disabled toggles neither change nor submit.
    §02

    Public surface

    API & styling

    Props

    id
    Explicit IDs override stable generated IDs.
    class / style
    Consumer additions compose with required styles.
    ref
    Element or callback where focus control is expected.
    children
    Typed content; raw HTML strings are never rendered.

    Slots & events

    children
    Primary content slot.
    onChange
    Typed value plus a small reason object when state changes.
    native events
    Composed without overwriting required handlers.

    State attributes

    • data-fui-toggle-button
    • data-fui-pressed
    • data-fui-disabled

    CSS tokens

    • --fui-toggle-button-*
    • --fui-focus-color
    • --fui-control-target
    §03

    Consumption

    Solid, Vite & Astro

    Solid / VitePRIVATE_BETA_PACKAGE_COORDINATE_REDACTED/ToggleButton
    import ToggleButton from 'PRIVATE_BETA_PACKAGE_COORDINATE_REDACTED/ToggleButton';
    
    <ToggleButton>Frauthy content</ToggleButton>
    Astroisland
    ---
    import ToggleButton from 'PRIVATE_BETA_PACKAGE_COORDINATE_REDACTED/ToggleButton';
    ---
    
    <ToggleButton client:visible>Frauthy content</ToggleButton>
    §04

    Verification

    Evidence record

    Scheduled

    Automated

    Batch C action tests cover controlled/default state, callback reasons, disabled state, aria-pressed, and hidden name/value submission.

    Target
    Brand 1.0.0-next.0 matrix
    Last verified
    Pending integrated G2 run
    Required

    Assistive technology

    Pending VoiceOver/Safari and NVDA/Firefox pressed-state announcement verification.

    Desktop
    VoiceOver/Safari · NVDA/Firefox
    Touch
    Required for touch-centric behavior
    Open

    Known issues

    • A hidden form input exists only while pressed; server handling must treat an absent name as false.
    §05

    Editorial guidance

    Do / don’t

    Do

    Use for an independently toggleable view or formatting option with a stable label.

    Don’t

    Do not use ToggleButton as a checkbox when native form semantics better express the choice.

    Release activity

    ToggleButton · Brand Core

    1 recorded change · 26 weeks
    1. 1.0.0-next.3

      Baseline public component contract.

    Version & provenance

    New in the v2 architecture

    There is no stable predecessor for this explicit compiled subpath. The v1 compatibility layer remains tested separately; visual and API diffs begin with the next prerelease.

    Current
    1.0.0-next.0
    Previous
    compatibility surface
    Deprecation
    none
    Replacement
    not applicable
    Next in Actions & collectionsButtonGroup