@cloudwick/astral-ui
v9.0.0
Published
UI Library for Cloudwick
Readme
Astral UI
UI Library for Cloudwick
Version - 9.0.0
Installation
Install the package in your project directory with:
# With npm:
npm i @cloudwick/astral-ui
# With yarn:
yarn add @cloudwick/astral-uiRequirements
This package has the following peer dependencies:
- React ^18.3.1
- React DOM ^18.3.1
Browser support
The published JavaScript and CSS target Chrome 87, Edge 88, Firefox 78 and Safari 14
(macOS and iOS) or later, as declared in the browserslist field of package.json. The
JavaScript uses ES2020 syntax such as ?. and ??; a toolchain that parses
node_modules without transpiling it (webpack 4, Create React App 4) needs to transpile
@cloudwick/astral-ui to build.
Available Components
Astral UI provides the following components:
- Accordion
- Avatar
- AvatarGroup
- Badge
- Breadcrumbs
- Button
- Card
- Checkbox
- CheckboxGroup
- CTAGroup
- DataTable
- DatePicker
- DistributionSlider
- Dropdown
- EmptyState
- FileUpload
- Loader
- Modal
- MultiSelectTransfer
- OtpInput
- Pagination
- Panel
- PanelGroup
- PasswordField
- Progress
- Radio
- RadioGroup
- Scrollbar
- Select
- Tabs
- Textarea
- TextCopy
- TextField
- Toast
- Toggle
- Tooltip
- TransferList
- Truncate
Tailwind CSS Configuration
Astral UI is built with Tailwind CSS. The library exports a Tailwind theme configuration that you can use in your project:
// In your tailwind.config.js
import { tailwindThemeConfig } from '@cloudwick/astral-ui';
export default {
// Your existing config
theme: {
extend: {
// Add Astral UI theme
...tailwindThemeConfig
}
}
}The theme includes configuration for:
- Colors (primary, secondary, gray, error, success, warning)
- Font families
- Font sizes
- Spacing
- Border radius
- Box shadows
- Animations
- And more
Documentation
For detailed documentation and examples of each component, please visit the documentation site.
Import Paths
You can import components as follows:
// Import from the main package
import { Button, Accordion, TextField } from '@cloudwick/astral-ui';The barrel is the only supported entry point. dist/** is internal and is not
resolvable as a subpath. Stylesheets and fonts are published under css/ and fonts/.
Tree-shaking
The ESM build ships one module per source file, unminified and annotated with
/*#__PURE__*/. The package's sideEffects field lists the stylesheets and
the bundled third-party modules whose own packages declare side effects. A
bundler that honours those — Vite, Rollup, webpack 5 — drops every component you
do not import, so the barrel import above costs only what you use. Importing
Progress alone produces about 89 KB minified (17 KB gzipped) in a Vite production
build, most of it tailwind-merge, rather than the whole library.
Astral UI does not export icons. Components draw their built-in icons (the Button
spinner, the Select chevron, close buttons, status icons) as internal SVGs, so a
component brings only the icons it uses. Icon props such as prefixIcon,
suffixIcon, toggledIcon and a DataTable filter's icon take a React node; use
@cloudwick/icons with a deep
default import so only the icons you use are bundled:
import IconSearch from "@cloudwick/icons/IconSearch";
<Button prefixIcon={<IconSearch size="sm" />}>Search</Button>Stylesheets
@import url("@cloudwick/astral-ui/css/fonts.min.css");
@import url("@cloudwick/astral-ui/css/index.min.css");These paths resolve through the exports map and exist on disk, so Vite, webpack 5,
postcss-import and Tailwind v4 all find them. The fonts are published under
@cloudwick/astral-ui/fonts/*, and fonts.min.css refers to them as ../fonts/*.
Vite, and webpack's css-loader resolving the @import itself, rewrite those URLs. When
postcss-import inlines the stylesheet, add postcss-url with { url: "rebase" } after it
so the font URLs resolve from the importing file.
