Skip to main content

Overview

ElementOptions is a compound component for building inline configuration popovers attached to elements. It provides form controls (Select, Toggle, Slider, ColorPicker, Input) and helper hooks for updating element properties.
Element Options example

Features

  • Compound components — Root, Trigger, Content, Group, Label, Separator
  • Form controls — Select, Toggle, Slider, ColorPicker, Input
  • Helper hooksuseElementOptions, useUpdateElementProps
  • Radix UI — Built on Radix Popover for accessibility and positioning

Installation

Basic Usage

API Reference

ElementOptions.Root

Root component that provides context and manages popover state.
Props:

ElementOptions.Trigger

Button that opens the options popover.
Props:

ElementOptions.Content

Floating content panel containing form controls.
Props:

ElementOptions.Group

Groups related controls together.

ElementOptions.Label

Label for a group of controls.

ElementOptions.Separator

Visual separator between groups.

ElementOptions.Select

Dropdown select for choosing from predefined options.
Props: SelectOption type:

ElementOptions.Toggle

Boolean toggle switch.
Props:

ElementOptions.Slider

Numeric slider for range values.
Props:

ElementOptions.ColorPicker

Color picker with presets and hex input.
Props:

ElementOptions.Input

Text input for string values.
Props:

Hooks

useElementOptions()

Access element context within Content.
Returns:

useUpdateElementProps<T>()

Helper hook for updating element properties.

Examples

Callout Theme Selector

Divider with Style and Color

Table Appearance Toggles

Table of Contents with Input and Toggles

Styling

CSS Variables

Custom Styling

Apply Tailwind or custom classes to components:

Best Practices

BlockOptions

Context menu for block-level actions

FloatingBlockActions

Floating buttons for block operations