Aurora AI Controls
aurora-dinglebear-ai/aurora-ai-controlsUnverifiedBlock
Aurora-native toolbar controls with horizontal and vertical layouts.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/dinglebear-ai/aurora/main/aurora-ai-controls.jsonSource
1"use client"23import * as React from "react"4import type { LucideIcon } from "lucide-react"5import { cn } from "@/lib/utils"67/* ------------------------------------------------------------------ *8 * Aurora · Controls (AI element)9 *10 * A toolbar cluster — a raised, rounded panel holding icon ControlButtons11 * with an optional active (cyan ring + tint) state, separated by hairline12 * ControlsDividers. Lays out horizontally by default; orientation="vertical"13 * stacks the cluster and rotates the dividers.14 *15 * Architecture (forwardRef, displayName, compound parts, HTMLAttributes16 * passthrough, full a11y on the button) is kept from the Aurora registry.17 * Prefer Lucide icon components for `icon`; raw SVG strings are intentionally18 * rejected so untrusted markup can never reach the DOM.19 * ------------------------------------------------------------------ */2021type ControlsOrientation = "horizontal" | "vertical"22type ControlIcon = LucideIcon | React.ReactElement<React.SVGProps<SVGSVGElement>>2324const OrientationContext = React.createContext<ControlsOrientation>("horizontal")2526export interface ControlsProps extends React.HTMLAttributes<HTMLDivElement> {27 orientation?: ControlsOrientation28}2930export interface ControlButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {31 /**32 * Lucide icon component or trusted SVG element. Mutually optional with `children`33 * (text-labelled buttons like "Fit").34 */35 icon?: ControlIcon36 /** Active / selected state — cyan ring, tint fill and accent glyph. */37 active?: boolean38}3940const Controls = ({ ref, orientation = "horizontal", className, style, children, ...props }: ControlsProps & { ref?: React.Ref<HTMLDivElement> }) => {41 const vertical = orientation === "vertical"42 return (43 <OrientationContext.Provider value={orientation}>44 <div45 ref={ref}46 className={cn("aurora-controls", className)}47 data-orientation={orientation}48 style={{49 display: "inline-flex",50 flexDirection: vertical ? "column" : "row",51 alignItems: "center",52 gap: 4,53 boxSizing: "border-box",54 padding: 6,55 background: "var(--aurora-surface-raised)",56 border: "1px solid var(--aurora-border-strong)",57 borderRadius: "var(--aurora-radius-1)",58 boxShadow: "var(--aurora-shadow-medium), var(--aurora-highlight-medium)",59 ...style,60 }}61 {...props}62// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from aurora
All 176 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Aurora AI Actionaurora-ai-action | aurora | Blocks | Unverified | 1 dep | |
| Aurora AI Actionsaurora-ai-actions | aurora | Blocks | Unverified | 1 dep | |
| Aurora AI Agentaurora-ai-agent | aurora | Blocks | Unverified | 1 dep | |
| Aurora AI Image Gridaurora-ai-ai-image-grid | aurora | Blocks | Unverified | 1 dep | |
| Aurora AI Attachmentsaurora-ai-attachments | aurora | Blocks | Unverified | 1 dep | |
| Aurora AI Audio Playeraurora-ai-audio-player | aurora | Blocks | Unverified | 1 dep | |
| Aurora AI Branchaurora-ai-branch | aurora | Blocks | Unverified | 1 dep | |
| Aurora AI Canvasaurora-ai-canvas | aurora | Blocks | Unverified | 1 dep |
