web library
Web-specific entry point for Lark applications.
Classes
- Accordion
- A set of collapsible sections.
- AccordionContent
- Accordion content.
- AccordionItem
- A single accordion item.
- AccordionTrigger
- Accordion trigger/header.
- Address
- An address element for contact information.
- Alert
- A callout to display important information.
- AlertDescription
- Alert description.
- AlertDialog
- A modal dialog for confirmations.
- AlertTitle
- Alert title.
- App
- The main Lark application runner.
- AppBar
- An application bar.
- AppConfig
- Application configuration loaded from environment.
- AppRunner
- VM-safe stub for the web app runner.
- AppShell
- Internal shell for routing.
- Article
- A semantic article container.
- Aside
- A semantic aside container (sidebars, pull quotes, etc).
- AspectRatio
- Maintains a specific aspect ratio for its child.
- Avatar
- An avatar image or initials.
- Badge
- A badge for status or counts.
- BaseEntry
- The base href tag.
- BlankLayout
- A layout that just renders the page without wrapping.
- Blockquote
- A blockquote element.
- Bottom navigation bar.
- Box
- A generic box container (Universal Primitive).
- Breadcrumb
- Navigation breadcrumbs.
- BreadcrumbEllipsis
- Breadcrumb ellipsis (for collapsed items).
- BreadcrumbItem
- A breadcrumb item.
- BreadcrumbList
- Breadcrumb list container.
- BreadcrumbSeparator
- Breadcrumb separator.
- BuildConfig
- Build configuration.
- Button
- A clickable button component.
- ButtonGroup
- A group of related buttons.
- Calendar
- A calendar for date selection.
- Card
- A card container with header, content, and footer.
- CardContent
- Card content section.
- CardDescription
- Card description.
- Card footer section.
- CardHeader
- Card header section.
- CardTitle
- Card title.
- Carousel
- A carousel/slider for content.
- CarouselContent
- Carousel content container.
- CarouselItem
- A carousel slide.
- CarouselNext
- Carousel next button.
- CarouselPrevious
- Carousel previous button.
- Checkbox
- A checkbox input.
- Collapsible
- A single collapsible section.
- CollapsibleContent
- Collapsible content.
- CollapsibleTrigger
- Collapsible trigger.
- Color
- A color represented by RGBA values.
- Colors
- Common colors.
- Column
- A vertical flex container.
- Component
- Abstract base class for all Lark UI components.
- ComponentInfo
- Information about a registered component.
- ComponentNode
- A node in the component tree.
- ComponentRegistry
- Registry of all mounted Component instances.
- ComponentSnapshot
- Snapshot of a component tree.
- ComponentTree
- The full component tree.
- ComponentVNode
- A VNode representing a Lark Component.
-
Computed<
T> - A cached derived value that automatically tracks dependencies.
- Constraints
- Immutable box constraints.
- Container
- A generic layout container.
- ContentItem
- A single item in the content catalog.
- ContentItemSection
- Represents a section extracted from document headings (## and ###).
- ContentQuery
- Query builder for Lark Content.
- ContextMenu
- A right-click context menu.
- ContextMenuContent
- Context menu content.
- ContextMenuItem
- Context menu item.
- ContextMenuLabel
- Context menu label.
- ContextMenuSeparator
- Context menu separator.
- CookieOptions
- Cookie options.
- CookieStorage
- Cookie storage abstraction.
- DatePicker
- A date picker with calendar popup.
-
Debounced<
T> - Result type for useDebounce.
- DevMessageV2
- Enhanced dev message with granular update information.
- DevTools
- Developer tools manager.
- DevToolsState
- Tracks all reactive state for DevTools inspection.
- Dialog
- A modal dialog.
- DialogClose
- Dialog close button.
- DialogContent
- Dialog content container.
- DialogDescription
- Dialog description.
- Dialog footer.
- DialogHeader
- Dialog header.
- DialogTitle
- Dialog title.
- Divider
- A horizontal divider line.
- DomPatcher
- VM-safe stub for DOM patching.
- DrawerClose
- Drawer close button.
- DrawerContent
- Drawer content container.
- DrawerDescription
- Drawer description.
- Drawer footer.
- DrawerHeader
- Drawer header.
- DrawerTitle
- Drawer title.
- DropdownMenu
- A dropdown menu.
- DropdownMenuContent
- Dropdown menu content.
- DropdownMenuGroup
- Dropdown menu group.
- DropdownMenuItem
- Dropdown menu item.
- DropdownMenuLabel
- Dropdown menu label.
- DropdownMenuSeparator
- Dropdown menu separator.
- Effect
- A reactive side effect that re-runs when dependencies change.
- Empty
- A component that renders nothing.
- EmptyContent
- Empty state content (actions).
- EmptyDescription
- Empty state description.
- EmptyHeader
- Empty state header.
- EmptyMedia
- Empty state media (icon, image, avatar).
- EmptyState
- Empty state for when there's no data.
- EmptyTitle
- Empty state title.
- Env
- Environment access.
- ErrorBoundary
- A component that catches errors in its children.
- ErrorContext
- Error context for reporting.
- ErrorReport
- Error report for tracking.
- ErrorReporter
- Error reporting configuration.
- Expanded
- Expands child in a flex context.
- FieldDef
- Defines a form field.
- Figure
- A figure container with optional caption.
- A semantic footer container.
-
FormField<
T> - Reactive state for a single form field.
- FormState
- Reactive form with validation and submit handling.
- Fragment
- Groups children without adding structure.
- GoogleFont
- Configuration for a single Google Font.
- GoogleFontsEngine
- Engine for generating Google Fonts links and scanning CSS.
- Grid
- A grid container.
- H1
- An h1 heading.
- H2
- An h2 heading.
- H3
- An h3 heading.
- H4
- An h4 heading.
- H5
- An h5 heading.
- H6
- An h6 heading.
- Head
- Head configuration object for LarkApp.
- HeadEntry
- Base class for all head entries.
- Header
- A semantic header container.
- Heading
- A heading element (h1-h6).
- HeadManager
- Central manager for all head tags.
- HmrState
- HMR state manager for preserving state across hot reloads.
- HtmlElement
- Base class for HTML elements.
- HtmlRenderer
- Renders a component tree to HTML string.
- HttpResponse
- Simple HTTP response wrapper.
- Hydration
- Manages hydration from SSG to SPA.
- Icon
- Displays an icon from Lucide (default) or custom icon fonts.
- Icons
- Lucide icon names - 1666 icons.
- Image
- Displays an image.
- Input
- A text input field.
- LarkApp
- The root component for a Lark application.
- LarkColors
- Helper for defining colors.
- LarkConfig
- Lark application configuration.
- LarkContent
- Access point for Lark Content.
- LarkDrawer
- A slide-out panel from the edge of the screen.
- LarkServerRenderer
- Renders Lark applications on the server.
- Layout
- Base class for layouts that wrap pages.
- Link
- A navigation link.
- LinkEntry
- A link tag.
- ListTile
- A list tile with media, content, header, and footer.
- ListTileContent
- ListTile content section.
- ListTileDescription
- ListTile description.
- ListTile footer section.
- ListTileHeader
- ListTile header section (above main content).
- ListTileMedia
- ListTile media section (icon, avatar, image).
- ListTileTitle
- ListTile title.
- LogConfig
- Global logging configuration.
- Logger
- A logger instance.
- Main
- A semantic main content container.
- Markdown
- Renders Markdown content as HTML.
- MemoryStorage
- In-memory storage fallback (for SSR or testing).
- MetaEntry
- A meta tag.
- MiddlewareRunner
- Middleware runner that executes a chain of middleware.
-
MutationOptions<
TData, TVariables, TContext> - Configuration options for a mutation.
- A semantic navigation container.
- Controls navigation flow in middleware.
- Item for bottom navigation.
- NetworkRequest
- A captured network request.
- NetworkTracker
- Tracks network requests for DevTools.
-
PageResult<
T> - Page result from fetcher.
- Paragraph
- A text paragraph.
- PerformanceMetrics
- Performance metrics collector.
- PersistenceAdapter
- Interface for store persistence (localStorage, etc).
- PinInput
- A PIN/OTP input field with individual character boxes.
- PlatformRenderer
- Interface for platform-specific renderers.
- Pressable
- A pressable area (Universal Primitive).
-
Previous<
T> - Result type for usePrevious.
- PrimitiveComponent
- Marker interface for primitive components (leaf nodes).
- Progress
- A progress indicator.
-
Provider<
T> - Provides a value to descendant components.
-
ProvideRef<
T> - Provides a reactive ref to descendants.
- QueryClient
- Central manager for query caching and invalidation.
-
QueryOptions<
T> - Configuration options for a query.
-
Radio<
T> - A radio button input.
- RawHtml
- A component that renders raw HTML strings.
- ReactiveNode
- Represents a node in the reactive dependency graph.
- ReactiveScope
- Manages the current reactive subscriber context.
-
ReadonlyRef<
T> - Read-only component of a reactive ref.
-
Ref<
T> - A reactive container that holds a value and notifies on change.
- RefSnapshot
- Snapshot of a ref for DevTools display.
- RenderNode
- Abstract render node that can layout and paint itself.
- Route
- Represents a route in the application.
- RouteCollection
- Route collection for matching.
- RouteDefinition
- Defines a route with path pattern and builder.
- RouteMatch
- Result of matching a URL against a route.
- Router
- The application router.
- RouterComponent
- A component that renders the matched route's component.
- RouterLink
- A link that navigates via the router without reloading the page.
- RouterOutlet
- A component that renders the nested route based on the current depth.
- Row
- A horizontal flex container.
- Scaffold
- A top-level container for an application structure.
- ScriptEntry
- A script tag.
- Section
- A semantic section container.
-
Select<
T> - A dropdown select.
-
SelectOption<
T> - ServerInit
- ServerRuntime
- Server runtime implementation.
- Sidebar
- A sidebar navigation drawer.
- SidebarContent
- Sidebar main content area.
- Sidebar footer area.
- SidebarGroup
- Group of sidebar items.
- SidebarHeader
- Sidebar header area.
- SidebarItem
- A navigation item in the sidebar.
- Size
- Immutable size representation.
- Skeleton
- A skeleton loading placeholder.
- Slider
- A range slider input.
- SourceLocation
- Source location for error reporting.
- Spacer
- An empty space with optional size.
- Spinner
- A loading spinner.
- StateChange
- A state change event.
- Step
- A single step in a stepper.
- Stepper
- A stepper/wizard for multi-step processes.
- Storage
- Abstract storage interface (implemented differently for web/server).
- Style
- A record type containing all supported CSS properties.
- StyleEntry
- An inline style tag.
- StyleRegistry
- Subscriber
- Represents a reactive consumer that can be notified of dependency changes.
- SubscriberStats
- Tracks statistics about a subscriber for debugging and profiling.
- Svg
- Displays an SVG image.
- SvgIcon
- Displays an inline SVG icon.
- Tab
- A tab trigger.
- Table
- A data table.
- TableBody
- Table body section.
- TableCaption
- Table caption.
- TableCell
- Table data cell.
- Table footer section.
- TableHead
- Table header cell.
- TableHeader
- Table header section.
- TableRow
- Table row.
- TabPanel
- A tab panel.
- Tabs
- Tabbed content sections.
- TabsList
- Tab list container.
- TailwindConfig
- Configuration for the Tailwind engine.
- Text
- A text span (Universal Primitive).
- TextArea
- A multi-line text input.
- TextLeaf
- Internal leaf node for text content.
- Theme
- Theme definition containing colors, spacing, and other design tokens.
- ThemeColors
- Color tokens for theming.
- ThemeConfig
- Defines a strongly-typed theme configuration for Lark Tailwind.
- ThemeRadius
- Border radius tokens.
- ThemeSpacing
- Spacing tokens.
- ThemeTypography
- Typography tokens.
- Time
- A time element with machine-readable datetime.
- TimelineEntry
- A single entry on the timeline.
- TimelineEvent
- Timeline event for debugging.
- TimelineProfiler
- Performance timeline profiler for DevTools.
- TimelineRecording
- A complete timeline recording session.
- TitleEntry
- The page title.
- Toggle
- Result type for useToggle.
- UrlResolver
- Normalizes and resolves asset URLs.
- VDomBuilder
- Builds VNodes from Lark Components.
- Video
- Displays a video.
- VNode
- A virtual DOM node for efficient diffing.
Enums
- AccordionType
- AlertVariant
- AlignContent
-
Values for
align-contentproperty. - AlignItems
-
Values for
align-itemsproperty. - AlignSelf
-
Values for
align-selfproperty. - AnimationDirection
-
Values for
animation-directionproperty. - AnimationFillMode
-
Values for
animation-fill-modeproperty. - AnimationPlayState
-
Values for
animation-play-stateproperty. - AvatarShape
- BackfaceVisibility
-
Values for
backface-visibilityproperty. - BackgroundAttachment
-
Values for
background-attachmentproperty. - BackgroundClip
-
Values for
background-clipproperty. - BackgroundOrigin
-
Values for
background-originproperty. - BackgroundRepeat
-
Values for
background-repeatproperty. - BackgroundSize
-
Values for
background-sizeproperty (keywords only). - BadgeSize
- BlendMode
-
Values for
background-blend-modeandmix-blend-modeproperties. - BorderCollapse
-
Values for
border-collapseproperty. - BorderStyle
- Values for border style properties.
- BoxSizing
-
Values for
box-sizingproperty. - ButtonGroupOrientation
- CalendarMode
- CaptionSide
-
Values for
caption-sideproperty. - Clear
-
Values for
clearproperty. - ColorScheme
- Dark mode preference.
- CssTextAlign
-
Values for
text-alignproperty. - Cursor
-
Values for
cursorproperty. - DarkMode
- Dark mode strategy for Tailwind.
- DevMessageSeverity
- Severity levels for dev messages.
- DevMessageType
- Types of dev messages.
- Direction
-
Values for
directionproperty. - Display
-
Values for
displayproperty. - DrawerSide
- DropdownAlign
- EmptyCells
-
Values for
empty-cellsproperty. - EmptyMediaVariant
- FetchStatus
- Detailed fetch status for distinguishing types of loading.
- FlexDirection
-
Values for
flex-directionproperty. - FlexWrap
-
Values for
flex-wrapproperty. - Float
-
Values for
floatproperty. - FontKerning
-
Values for
font-kerningproperty. - FontStretch
-
Values for
font-stretchproperty. - FontStyle
-
Values for
font-styleproperty. - FontVariant
-
Values for
font-variantproperty. - FontWeight
-
Values for
font-weightproperty (keywords only). - GridAutoFlow
-
Values for
grid-auto-flowproperty. - HeadCategory
- Tag categories for grouping and deduplication.
- HeadLayer
- Priority layers for tag resolution. Higher priority layers override lower ones for tags with the same key.
- HydrationState
- Hydration state.
- Hyphens
-
Values for
hyphensproperty. - ImageFit
- ImageRendering
-
Values for
image-renderingproperty. - InputType
- Isolation
-
Values for
isolationproperty. - JustifyContent
-
Values for
justify-contentproperty. - ListStylePosition
-
Values for
list-style-positionproperty. - ListStyleType
-
Values for
list-style-typeproperty. - LogLevel
- Log levels.
- NetworkRequestStatus
- Status of a network request.
- ObjectFit
-
Values for
object-fitproperty. - Overflow
-
Values for
overflowproperties. - PageBreak
-
Values for
page-break-afterandpage-break-beforeproperties. - PageBreakInside
-
Values for
page-break-insideproperty. - PointerEvents
-
Values for
pointer-eventsproperty. - Position
-
Values for
positionproperty. - QueryStatus
- The current status of a query.
- RenderTarget
- How to render the application.
- Resize
-
Values for
resizeproperty. - ScrollBehavior
-
Values for
scroll-behaviorproperty. - Side
- StateChangeType
- Type of state change event.
- StepperOrientation
- StepStatus
- TableLayout
-
Values for
table-layoutproperty. - TableSortDirection
- TextAlignLast
-
Values for
text-align-lastproperty. - TextDecorationLine
-
Values for
text-decoration-lineproperty. - TextDecorationStyle
-
Values for
text-decoration-styleproperty. - TextJustify
-
Values for
text-justifyproperty. - TextOverflow
-
Values for
text-overflowproperty (keywords only). - TextTransform
-
Values for
text-transformproperty. - TimelineEntryType
- Type of timeline entry.
- TransformStyle
-
Values for
transform-styleproperty. - UserSelect
-
Values for
user-selectproperty. - Visibility
-
Values for
visibilityproperty. - WhiteSpace
-
Values for
white-spaceproperty. - WordBreak
-
Values for
word-breakproperty. - WordWrap
-
Values for
word-wrap/overflow-wrapproperty. - WritingMode
-
Values for
writing-modeproperty.
Extension Types
Constants
- serverInit → const ServerInit
- Marks a method to run on the server before rendering.
Properties
- appLog → Logger
-
Global app logger.
final
- devTools → DevTools
-
Shorthand to access devtools.
no setter
- email ↔ Validator
-
Validates email format.
getter/setter pair
- env → Env
-
Global env instance.
final
-
hotReloadVersion
→ Ref<
int> -
Global signal that increments whenever a hot reload occurs.
final
- isDev → bool
-
Convenience getters.
no setter
- isHydrated → bool
-
Whether hydration is complete.
no setter
- isHydrating → bool
-
Whether currently hydrating.
no setter
- isProd → bool
-
no setter
- isTest → bool
-
no setter
- localStorage → Storage
-
Get localStorage (falls back to memory storage).
no setter
- queryClient → QueryClient
-
Global query client instance.
final
- required ↔ Validator
-
Requires a non-empty value.
getter/setter pair
- sessionStorage → Storage
-
Get sessionStorage (falls back to memory storage).
no setter
-
storeRefRegistry
→ Map<
String, List< (String, Ref)> > -
Read-only access to the store refs (for HMR).
no setter
-
storeRegistry
→ Map<
String, dynamic> -
Read-only access to the store registry (for HMR and dev tools).
no setter
- styleRegistry → StyleRegistry
-
Global style registry.
final
Functions
-
batch<
T> (T fn()) → T - Groups multiple ref updates into a single notification cycle.
-
clearAllStores(
) → void - Clears all stores.
-
clearStore(
String name) → void - Clears a store (useful for testing or logout).
-
cn(
List classes) → String -
computed<
T> (T compute(), {EqualityFn< T> ? equals, String? name}) → Computed<T> - Creates a new computed value that automatically tracks dependencies.
-
configureCookies(
CookieStorage storage) → void - Configure cookie storage.
-
configureDarkModeAutoApply(
void apply(bool isDark)) → void - Configure auto-application of dark mode class.
-
configureDarkModeDefaultPreference(
ColorScheme preference) → void - Configure the default preference used when nothing is stored yet.
-
configureDarkModeDetection(
bool detector()) → void - Configure system preference detection.
-
configureDarkModeDomSync(
{required bool enabled}) → void - Enable/disable applying dark class updates to the DOM.
-
configureDarkModeSystemObserver(
void Function()? observer(void onChange(bool isDark))) → void - Configure system preference observation for live updates.
-
configureFetch(
{required HttpGet get, required HttpPost post}) → void - Configure the HTTP client for fetch operations.
-
configureStorage(
{Storage? local, Storage? session}) → void - Configure storage for the platform.
-
createApp(
LarkApp root) → AppRunner -
createCounterStore(
String name, {int initial = 0}) → ({Ref< int> count, void Function() decrement, void Function() increment, void Function() reset}) Function() - Creates a simple counter store.
-
createLogger(
String name) → Logger - Creates a logger for a component.
-
createSsgApp(
Component root, {RenderTarget target = RenderTarget.html}) → App - Creates a Lark app for SSG (static site generation).
-
createToggleStore(
String name, {bool initial = false}) → ({void Function() setFalse, void Function() setTrue, void Function() toggle, Ref< bool> value}) Function() - Creates a simple toggle store.
-
custom(
String? fn(dynamic value)) → Validator - Custom validator.
-
cva(
{String? base, Map< String, Map< ? variants, List<String, String> >Map< ? compoundVariants, Map<String, dynamic> >String, String> ? defaultVariants}) → VariantFunction - Creates a variant configuration function.
-
defineStore<
T> (String name, T setup(), {bool persist = false}) → T Function() - Defines a reactive store.
-
effect(
EffectFn fn, {String? name}) → void Function() - Creates and runs a new reactive effect.
-
field(
{dynamic initialValue, List< Validator> validators = const []}) → FieldDef - Creates a field definition.
-
getMiddleware(
String name) → MiddlewareFn? - Gets a registered middleware by name.
-
getMiddlewareList(
List< String> names) → List<MiddlewareFn> - Gets multiple middleware by names.
-
hydrateApp(
Component root, String selector) → Future< void> - Hydrates an SSG pre-rendered app.
-
maxLength(
int n) → Validator - Requires maximum length.
-
minLength(
int n) → Validator - Requires minimum length.
-
onMount(
CleanupFn? fn()) → void Function() - Creates an effect that only runs once on mount.
-
onStoreInit(
void callback(String)) → void - Register a callback to be called when a store is initialized.
-
pattern(
RegExp regex, {String message = 'Invalid format'}) → Validator - Validates against a regex pattern.
-
propertiesToCss(
Style props) → String -
ref<
T> (T initialValue, {EqualityFn< T> ? equals, String? name}) → Ref<T> - Creates a new reactive ref with the given initial value.
-
registerMiddleware(
String name, MiddlewareFn middleware) → void - Registers a named middleware.
-
registerStoreRef(
Ref r, String? name) → void -
renderPage(
Component component, {String? title, String? lang = 'en', bool pretty = false}) → String - Renders a full HTML page with meta tags.
-
renderToHtml(
Component root, {required String path, Map< String, String> ? query, Map<String, String> ? headers, bool pretty = false}) → Future<RenderResult> - Render a component to HTML string.
-
renderToString(
Component component, {bool pretty = false}) → String - Renders a component to HTML string (SSG).
-
reportError(
Object error, [StackTrace? stackTrace, String? context]) → void - Reports an error with optional context.
-
resetDarkModeSystemTrackingForTesting(
) → void - Test helper to reset cached system dark mode tracking state.
-
route(
String path, Component builder(Map< String, String> params), {String? name, List<String> middleware = const [], List<RouteDefinition> children = const [], FutureOr<Object?> loader(RouteMatch match)?, Map<String, dynamic> meta = const {}}) → RouteDefinition - Creates route definitions.
-
runWithHeadManager<
T> (HeadManager manager, T fn()) → T - Run a function with a specific HeadManager.
-
runWithRouter<
T> (Future< T> fn(Router router)) → Future<T> - Run a function with an isolated Router instance.
-
setPersistenceAdapter(
PersistenceAdapter adapter) → void - Sets the persistence adapter.
-
setRefRegistrationCallback(
void callback(Ref, String?)) → void - Sets the ref registration callback (called by store module).
-
setTheme(
Theme theme) → void - Sets the current theme.
-
stylesToCss(
Map< String, Style> styles) → String - Converts a map of typed styles to a CSS string.
-
styleToMap(
Style props) → Map< String, String> - Converts a Style record to a CSS style map.
-
untrack<
T> (T fn()) → T - Runs a function without tracking any dependencies.
-
useAsync<
T> (Future< T> fn(), {bool immediate = false}) → AsyncResult<T> - Manage async operation state.
-
useContentSeo(
Map< String, dynamic> metadata, {String? type, String? canonical, String? baseUrl}) → void - Applies SEO metadata from a content item's frontmatter.
-
useContext<
T> () → T -
Retrieves a provided value of type
T. -
useContextOrNull<
T> () → T? -
Retrieves a provided value of type
T, or null if not found. -
useContextRef<
T> () → Ref< T> -
Retrieves a provided reactive ref of type
T. -
useContextRefOrNull<
T> () → Ref< T> ? -
Retrieves a provided reactive ref of type
T, or null if not found. -
useCookie(
String name, {CookieOptions options = const CookieOptions()}) → CookieResult - Create a reactive ref backed by a cookie.
-
useDarkMode(
{String storageKey = _darkModeStorageKey}) → DarkModeResult - Create a reactive dark mode controller with persistence.
-
useDebounce<
T> (Ref< T> source, Duration delay) → Debounced<T> -
Creates a debounced version of
source. -
useFetch<
T> (String url, {T transform(dynamic json)?, Map< String, String> ? headers, bool immediate = true, bool server = true, bool client = true, String? key}) → FetchResult<T> - Fetch data from a URL with reactive state tracking.
-
useForm(
Map< String, FieldDef> fields) → FormState - Creates a reactive form.
-
useHead(
List< HeadEntry> entries) → void - Add custom head entries.
-
useHeadManager(
) → HeadManager - Gets current head manager.
-
useInfiniteScroll<
T> ({required Future< PageResult< fetcher(int page), bool immediate = true}) → InfiniteScrollResult<T> >T> - Create an infinite scroll data source.
-
useLazyFetch<
T> (String url, {T transform(dynamic json)?, Map< String, String> ? headers}) → FetchResult<T> - Lazy fetch - only fetches when execute() is called.
-
useLazyQuery<
T> ({required QueryKey key, required Future< T> queryFn(), required Ref<bool> enabled, QueryOptions<T> ? options}) → QueryResult<T> - Create a disabled query that only fetches when enabled.
-
useLocalStorage(
String key, {String? defaultValue}) → StorageResult< String?> - Create a reactive ref backed by localStorage.
-
useLocalStorageJson<
T> ({required String key, required T defaultValue, required T fromJson(Map< String, dynamic> ), required Map<String, dynamic> toJson(T)}) → StorageResult<T> - Typed localStorage helper with JSON serialization.
-
useMeta(
{String? title, String? description, String? ogTitle, String? ogDescription, String? ogImage, String? ogType, String? ogUrl, String? twitterCard, String? twitterTitle, String? twitterDescription, String? twitterImage, String? canonical, String? robots, String? author, String? themeColor, Map< String, String> ? custom}) → void - Sets page meta tags.
-
useMutation<
TData, TVariables, TContext> ({required Future< TData> mutationFn(TVariables variables), MutationOptions<TData, TVariables, TContext> ? options}) → MutationResult<TData, TVariables> - Perform data modifications with optimistic updates and cache invalidation.
-
usePagination<
T> ({required Future< PageResult< fetcher(int page), int initialPage = 1, bool immediate = true}) → PaginationResult<T> >T> - Create a paginated data source.
-
useParams(
) → Map< String, String> - Returns route params (reactive via route).
-
usePolling<
T> ({required Future< T> fetcher(), required Duration interval, bool immediate = true}) → PollingResult<T> - Poll data at regular intervals.
-
usePost<
T> (String url, {T transform(dynamic json)?, Map< String, String> ? headers}) → HttpMutationResult<T> - Perform a POST request.
-
usePrevious<
T> (Ref< T> source) → Previous<T> -
Creates a ref that tracks the previous value of
source. -
useQuery<
T> ({required QueryKey key, required Future< T> queryFn(), QueryOptions<T> ? options}) → QueryResult<T> - Fetch and cache server data with automatic state management.
-
useQueryParams(
) → Map< String, String> - Returns query params (reactive via route).
-
useRoute(
) → Route - Returns the current route (reactive).
-
useRouter(
) → Router - Returns the router instance.
-
useRouteRef(
) → Ref< Route> - Returns the current route as a reactive ref.
-
useSeo(
{String? title, String? description, String? image, String? url, String? type, String? ogTitle, String? ogDescription, String? ogImage, String? twitterTitle, String? twitterDescription, String? twitterCard, String? canonical, String? robots, String? author, List< String> ? keywords, String? themeColor, String? favicon, String? appleTouchIcon, String? manifest}) → void - Unified SEO API with automatic platform fallbacks.
-
useSessionStorage(
String key, {String? defaultValue}) → StorageResult< String?> - Create a reactive ref backed by sessionStorage.
-
useTheme(
) → Theme - Gets the current theme.
-
useThrottle<
T> (Ref< T> source, Duration interval) → Debounced<T> -
Creates a throttled version of
source. -
useToggle(
[bool initial = false]) → Toggle - Creates a reactive boolean toggle.
Typedefs
-
AsyncResult<
T> = ({Ref< T?> data, Ref<String?> error, Future<void> Function() execute, Ref<bool> loading, void Function() reset}) - Result type for useAsync.
- CleanupFn = void Function()
- Represents a cleanup function returned from an effect.
-
CookieResult
= ({void Function() remove, void Function(String value) set, Ref<
String?> value}) - Result type for useCookie.
-
DarkModeResult
= ({ReadonlyRef<
bool> isDark, ReadonlyRef<String> mode, Ref<ColorScheme> preference, void Function() setDark, void Function() setLight, void Function() setSystem, void Function() toggle}) - Result type for useDarkMode.
- EffectFn = CleanupFn? Function()
- A function that can optionally return a cleanup function.
-
EqualityFn<
T> = bool Function(T previous, T next) - A function that compares two values for equality.
-
FetchResult<
T> = ({Ref< T?> data, Ref<String?> error, Future<void> Function() execute, Ref<bool> loading, Future<void> Function() refresh}) - Result type for useFetch.
-
HttpGet
= Future<
HttpResponse> Function(String url, {Map<String, String> ? headers}) -
HttpMutationResult<
T> = ({Ref< T?> data, Ref<String?> error, Future<void> Function(Object? body) execute, Ref<bool> loading}) - Result type for mutations (POST, PUT, DELETE).
-
HttpPost
= Future<
HttpResponse> Function(String url, {Object? body, Map<String, String> ? headers}) -
InfiniteScrollResult<
T> = ({Ref< String?> error, Ref<bool> hasMore, Ref<bool> initialLoading, Ref<List< items, Future<T> >void> Function() loadMore, Ref<bool> loading, Future<void> Function() refresh}) - Result type for useInfiniteScroll.
- MiddlewareFn = void Function(Route to, Route from, NavigationControl next)
- A function that guards route navigation.
-
MutationResult<
TData, TVariables> = ({Ref< TData?> data, Ref<String?> error, ReadonlyRef<bool> isError, ReadonlyRef<bool> isIdle, ReadonlyRef<bool> isPending, ReadonlyRef<bool> isSuccess, void Function(TVariables variables) mutate, Future<TData> Function(TVariables variables) mutateAsync, void Function() reset, Ref<QueryStatus> status, Ref<TVariables?> variables}) - Result type for useMutation.
-
PaginationResult<
T> = ({Ref< String?> error, Future<void> Function(int page) goToPage, Ref<bool> hasMore, Ref<List< items, Future<T> >void> Function() loadMore, Future<void> Function() loadPrevious, Ref<bool> loading, Ref<int> page, Future<void> Function() refresh, Future<void> Function() reset, Ref<int?> total}) - Result type for usePagination.
-
PollingResult<
T> = ({Ref< bool> active, Ref<T?> data, Ref<String?> error, Future<void> Function() fetchNow, void Function() start, void Function() stop}) - Result type for usePolling.
-
QueryKey
= List<
Object?> - A query key uniquely identifies cached data.
-
QueryResult<
T> = ({Ref< T?> data, Ref<DateTime?> dataUpdatedAt, void Function() dispose, Ref<String?> error, Ref<FetchStatus> fetchStatus, ReadonlyRef<bool> isError, ReadonlyRef<bool> isFetching, ReadonlyRef<bool> isLoading, ReadonlyRef<bool> isPending, ReadonlyRef<bool> isStale, ReadonlyRef<bool> isSuccess, Future<void> Function() refetch, Ref<QueryStatus> status}) - Result type for useQuery.
- RebuildCallback = void Function()
- Callback for when a component needs to rebuild.
-
StorageResult<
T> = ({void Function() remove, void Function(T value) set, Ref< T> value}) - Result type for useLocalStorage.
- Validator = String? Function(dynamic value)
- A validation function that returns an error message or null.
-
VariantFunction
= String Function([Map<
String, dynamic> ? props])
Exceptions / Errors
- EnvError
- Environment error.
- RouteNotFoundException
- Thrown when no route matches the current path.