alepha@docs:~/docs/packages/@alepha-ui$
cat core.md
1 min read
Last commit:

#@alepha/ui - Core

UI components and themes for Alepha framework based on Mantine UI library.

#Installation

npm install @alepha/ui

#Overview

Mantine

#API Reference

#Hooks

Hooks provide a way to tap into various lifecycle events and extend functionality. They follow the convention of starting with use and return configured hook instances.

#useDialog()

Use this hook to access the Dialog Service for showing various dialog types.

tsx
1const dialog = useDialog();2await dialog.alert({ title: "Alert", message: "This is an alert message" });3const confirmed = await dialog.confirm({ title: "Confirm", message: "Are you sure?" });4const input = await dialog.prompt({ title: "Input", message: "Enter your name:" });

#useTheme()

Hook to get and set the current theme.

Returns a tuple with the current theme and a function to set the theme.

tsx
1const [theme, setTheme] = useTheme();

#useToast()

Use this hook to access the Toast Service for showing notifications.

tsx
1const toast = useToast();2toast.success({ message: "Operation completed successfully!" });3toast.error({ title: "Error", message: "Something went wrong" });
On This Page
No headings found...
ready
mainTypeScript
UTF-8packages_alepha_ui_core.md