Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Web docs
Navigation

SpeedDial

Expands a floating primary action into a compact set of related actions.

FrameworksAstro · React · Elements

Registry commandlumen add SpeedDial

InteractionEnhanced runtime

01

See it and copy it

Framework example

Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.

AstroSame visual contract, native framework API
Project canvasWhat would you like to add?Open the quick-create menu to choose an action.
  • Framework usage

    Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens and ui-* class contract.
    astro
    ---
    import { SpeedDial } from '@santi020k/lumen-astro'
    ---
    
    <div class="speed-dial-example">
      <div class="speed-dial-example__copy">
        <span>Project canvas</span>
        <strong>What would you like to add?</strong>
        <small>Open the quick-create menu to choose an action.</small>
      </div>
    
      <SpeedDial
        actions={[
          { icon: 'file-plus-2', label: 'New document', value: 'document' },
          { icon: 'folder-plus', label: 'New folder', value: 'folder' },
          { icon: 'image-plus', label: 'Upload media', value: 'media' }
        ]}
        defaultOpen
        label="Create new"
      />
    </div>
    
    <style>
      .speed-dial-example {
        display: flex;
        width: min(100%, 42rem);
        min-height: 17rem;
        align-items: flex-end;
        justify-content: space-between;
        gap: 2rem;
        margin-inline: auto;
        padding: 2rem;
        border: 1px solid hsl(var(--line));
        border-radius: 1rem;
        background: hsl(var(--surface) / 0.78);
        box-shadow: var(--ui-shadow-md);
      }
    
      .speed-dial-example__copy {
        display: grid;
        align-self: flex-start;
        gap: 0.35rem;
      }
    
      .speed-dial-example__copy span {
        color: hsl(var(--brand));
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.09em;
        text-transform: uppercase;
      }
    
      .speed-dial-example__copy strong {
        color: hsl(var(--ink));
        font-size: 1.1rem;
      }
    
      .speed-dial-example__copy small {
        max-width: 23rem;
        color: hsl(var(--ink-muted));
        line-height: 1.55;
      }
    
      @media (max-width: 36rem) {
        .speed-dial-example {
          min-height: 20rem;
          padding: 1.25rem;
        }
    
        .speed-dial-example__copy {
          max-width: 11rem;
        }
      }
    </style>
    Edit SpeedDial in browser
    02

    Choose your target

    Add this component

    Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.

    bash@santi020k/lumen-astro
    pnpm add @santi020k/lumen-astro
    pnpm add @santi020k/lumen-astro
    bashAstro wrapper
    lumen add SpeedDial
    lumen add SpeedDial

    API reference

    Lumen-specific props and runtime attributes for the Astro primitive. React props follow the same names; Elements use equivalent kebab-case attributes where custom elements expose them.

    AttributeValuesDefaultDescription
    actionsArray<{ icon?, label, value? }>[]Creates labelled menu actions and renders optional Lumen icons.
    defaultOpenbooleanfalseSets the initial expanded state.
    direction"up" | "down" | "left" | "right""up"Controls the direction in which actions expand.
    labelstring"Actions"Names both the trigger and its action menu for assistive technology.
    UIPrimitivesAstro runtimerequiredAdds click-away dismissal and complete trigger and menu keyboard behavior. React provides equivalent behavior.
    class, classNamestring""Merges custom classes with the generated ui-* root classes.
    ...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.

    Keyboard interactions

    Keyboard behavior provided by the Astro UIPrimitives runtime for this component.

    KeyAction
    Enter, Space on triggerOpen or close the action menu.
    Arrow keys on triggerOpen the menu and move focus to its first or last action.
    Arrow keys in menuMove focus through actions, wrapping at either end.
    Home, End in menuMove focus to the first or last action.
    EscapeClose the action menu and return focus to the trigger.

    Web docsFull catalog