Getting startedA quick tutorial to get you up and running with Apsara. In this quick tutorial, we will install and style the Popover component. Install the component from your command line.
npm install @raystack/apsara@latest
Import and structure the parts.
import * as React from 'react';
import { Popover, PopoverTrigger, PopoverContent } from '@raystack/apsara';

const PopoverDemo = () => (
  <Popover>
    <PopoverTrigger>More info</PopoverTrigger>
      <PopoverContent>
        Some more info…
      </PopoverContent>
  </Popover>
);

export default PopoverDemo;
Add styles where desired.
import * as React from 'react';
import * as Popover from '@radix-ui/react-popover';

const PopoverDemo = () => (
  <Popover>
    <PopoverTrigger>More info</PopoverTrigger>
      <PopoverContent>
        Some more info…
      </PopoverContent>
  </Popover>
);

export default PopoverDemo;
The steps above outline briefly what's involved in using a Radix Primitive in your application. These components are low-level enough to give you control over how you want to wrap them. You're free to introduce your own high-level API to better suit the needs of your team and product. In a few simple steps, we've implemented a fully accessible Popover component, without having to worry about many of its complexities.
  • Adheres to WAI-ARIA design pattern.
  • Can be controlled or uncontrolled.
  • Customize side, alignment, offsets, collision handling.
  • Optionally render a pointing arrow.
  • Focus is fully managed and customizable.
  • Dismissing and layering behavior is highly customizable.