npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

sdk-astrix

v0.0.23

Published

`npm i sdk-astrix`

Downloads

77

Readme

Astrix SDK

npm i sdk-astrix

Available Components and Functions

Components that can be used directly:

  1. Tag
  2. Separator
  3. Avatar
  4. Spinner
  5. LocationIcon
  6. CalendarIcon
  7. Switch
  8. Button
  9. Dropdown
  10. InputField
  11. RadioGroup
  12. InfoTooltip
  13. EventCard
  14. RangeSlider
  15. Modal
  16. SidebarDrawer
  17. TagInput
  18. SearchInput
  19. TrafficByLocationCard
  20. TotalRevenueCard
  21. TrafficBySourceCard
  22. CopyButton
  23. TermsAndConditonsCard
  24. Table
  25. MapCard
  26. ShareEventCard
  27. ShareOnSocialGrid
  28. SpotifySongCard
  29. AvatarUploader
  30. TicketBar
  31. ArtistTile
  32. DeleteIcon
  33. UploadIcon
  34. CategoryCapsule
  35. SpotifySongBar
  36. ImageUploader
  37. EventGalleryUploader
  38. EventImageGallery
  39. ArtistAvatar
  40. UserDetailsCardMobile
  41. TicketDetailsCardMobile
  42. EventDetailsCardMobile
  43. AttendeesTile
  44. TabsBar
  45. AttendeesCard
  46. QRCode
  47. EventTile
  48. TicketSoldCard
  49. PastTicketCardMobile
  50. TicketCardMobile
  51. TicketSalesChart
  52. DesktopSidebar
  53. AddFeatureCard
  54. ColorPopup
  55. AddFeatureCard
  56. VerticalDrawer
  57. TextEditor
  58. EventCardMobile
  59. EventBannerMobile
  60. VenueBar
  61. Header
  62. ConversionRateChart
  63. TopBar
  64. LinkClicksChart

Functions that can be used directly:

  1. formatDateInIST
  2. formatTimeInIST
  3. adjustColorOpacity
  4. getEventStatus
  5. cn

How to use :

  1. Tag
<Tag label="testing tag" className=""/>
  1. Separator
<Separator title="" className="" titleClassName="" lineClassName=""/>
  1. Avatar
<Avatar imgSrc="" className="" imgClassName=""/>
  1. Spinner
<Spinner color="#ff4400" size="lg" />
  1. Location Icon
 <LocationIcon color="#ff4400" width={20} height={20} />
  1. Calendar Icon
 <CalendarIcon color="#ff4400" width={20} height={20} />
  1. Switch
<Switch
        checked={isEnabled}
        onChange={setIsEnabled}
        size="md"
        className="my-4"
        thumbClassName="shadow-md"
        trackClassName="peer-checked:bg-green-500"
/>
  1. Button
<Button>Button Primary</Button>

<Button variant="secondary" size="md">Button Secondary</Button>
  1. Dropdown
<Dropdown
        options={["Apple", "Banana", "Orange"]}
        value={selectedFruit}
        onChange={(value) => setSelectedFruit(value)}
        placeholder="Select a fruit"
        />

<Dropdown
        options={[
          { value: "1", label: "Option 1" },
          { value: "2", label: "Option 2" },
          { value: "3", label: "Option 3" },
        ]}
        value={selectedOption}
        onChange={(value) => setSelectedOption(value)}
/>
  1. InputField
<InputField
        label="Name"
        placeholder="Enter your name"
        value={value}
        onChange={(e) => setValue(e.target.value)}
        iconSrc="/icons/user.svg"
        error={!value ? "Name is required" : ""}
/>

or

<InputField
  label="Bio"
  variant="textarea"
  placeholder="Write a short bio..."
  rows={4}
/>
  1. RadioGroup
 <RadioGroup
        options={options}
        value={selected}
        onChange={setSelected}
        name="example"
        direction="horizontal"
        size="md"
/>

      or

<RadioGroup
  options={[
    { value: "small", label: "Small" },
    { value: "medium", label: "Medium" },
    { value: "large", label: "Large" }
  ]}
  value="medium"
  onChange={(val) => console.log(val)}
  name="size-selection"
  direction="vertical"
  size="lg"
/>
  1. InfoTooltip
<InfoTooltip message="this is default"/>
<InfoTooltip message="this is left" position="left"/>
<InfoTooltip message="this is right" position="right"/>
<InfoTooltip message="this is bottom" position="bottom"/>
  1. EventCard
 <EventCard
        onClick={() => alert("desktop event card clicked")}
        eventTitle="shdsh"
        imgSrc=""
        location="345"
        organiserImg=""
        organiserName="slkd"
        startDate="345"
        tags={["text", "text"]}
      />
  1. RangeSlider
<RangeSlider
        min={0}
        max={500}
        step={10}
        value={price}
        onChange={setPrice}
        color="#60a5fa"
        className="mt-2"
        trackClassName="bg-blue-100"
        thumbClassName="shadow-lg"
/>
  1. Modal
//define a state
const [isModalOpen, setIsModalOpen] = useState(false);

// a button to change the state
<button
        onClick={() => setIsModalOpen(true)}
        Open Modal
</button>

<Modal
        isOpen={isModalOpen}
        onClose={() => setIsModalOpen(false)}
        title="Confirmation"
      >
        //your code here
</Modal>
  1. SidebarDrawer
//define a state
 const [isDrawerOpen, setIsDrawerOpen] = useState(false);


// button to toggle the state
<button
        onClick={() => setIsDrawerOpen(true)}
      >
        Open Sidebar
</button>

<SidebarDrawer
        isOpen={isDrawerOpen}
        onClose={() => setIsDrawerOpen(false)}
        title="Menu"
        position="right" // or "left"
        width="w-96" // optional, controls drawer width
      >
       //your code here
</SidebarDrawer>
  1. TagInput
<TagInput
  initialTags = [],
  onTagsChange,
  placeholder = "Type and press Enter...",
  className = "",
  inputClassName = "",
  tagContainerClassName = "",
  tagClassName = "",
  maxTags,
  disabled = false,
  error,
/>
  1. SearchInput
<SearchInput
      value={searchTerm}
      onChange={setSearchTerm}
      onSearch={handleSearch}
      placeholder="Search users..."
      className=""
      iconClassName=""
      inputClassName=""
      resetButtonClassName=""
/>
  1. TrafficByLocationCard
<TrafficByLocation
  data={yourData}
/>

or

<TrafficByLocation
  data={yourData}
  colorPalette={["#FF6384", "#36A2EB", "#FFCE56", "#4BC0C0", "#9966FF"]}
  className=""
  isLoading={true}
  labelClassName=""
/>
  1. TotalRevenueCard
<TotalRevenueCard
  value={150000}
  eventRevenue={100000}
  collectibleRevenue={50000}
/>

      or

<TotalRevenueCard
  title="Monthly Revenue"
  subTitle="April 2025"
  value={200000}
  eventRevenue={120000}
  collectibleRevenue={80000}
  className="bg-gray-900"
  titleClassName="text-green-300"
  containerClassName="bg-green-100/10"
  iconClassName="text-green-400"
/>
  1. TrafficBySourceCard
<TrafficBySourceCard data={mockTrafficData} />

or

<TrafficBySourceCard data={mockTrafficData}
  color="#ff44ee"
  labelClassName=""
/>
  1. CopyButton
 <CopyButton textToCopy={} className="" />
  1. TermsAndConditionsCard
<TermsAndConditionsCard text="" className="" btnClassName="" textContainerClassName=""/>
  1. Table
//mockdata
const users = [
  { name: "Alice", email: "[email protected]", role: "Admin" },
  { name: "Bob", email: "[email protected]", role: "Editor" },
  { name: "Alice", email: "[email protected]", role: "Admin" },
];

 <Table
        headers={headers}
        data={users}
        renderRow={(user, idx) => (
          <tr key={idx}>
            <td className="px-4 py-2">{user.name}</td>
            <td className="px-4 py-2">{user.email}</td>
            <td className="px-4 py-2">{user.role}</td>
          </tr>
        )}
        tableClassName=""
        tableHeaderClassName=""
        tableBodyClassName=""
/>
  1. MapCard
<MapCard
        apiKey="YOUR_GOOGLE_API"
        venue="Siri Fort Auditorium"
        location="New Delhi, India"
        color="#FF5C5C"
/>
  1. ShareEventCard
 <ShareEventCard
        eventImageUrl="https://placehold.co/600x400.png"
        eventName="Future Sound Festival"
        username="astro_user42"
        avatarUrl="https://placehold.co/600x400.png"
        linkToShare="https://youreventlink.com"
/>
  1. ShareOnSocialGrid
<ShareOnSocialGrid
  linkToShare="slkdjf"
  className=""
  gridClassName=""
  iconClassName=""/>
  1. SpotifySongCard
<SpotifySongCard
        spotifyData={{
          tracks: [{ id: "0VjIjW4GlUZAMYd2vXMi3b" }],
          playlists: [],
        }}
/>

      or

<SpotifySongCard
  spotifyData={{
    tracks: [],
    playlists: [{ id: "37i9dQZF1DXcBWIGoYBM5M" }],
  }}
/>
  1. AvatarUploader
<AvatarUploader
  className=""
  imgClassName=""
  editButtonClassName=""
  imgUrl=""
/>
  1. TicketBar
{mockTickets.map((ticket, index) => (
  <TicketBar
          key={ticket.id}
          ticketName={ticket.ticketName}
          ticketType={ticket.ticketType}
          price={ticket.price}
          availableQuantity={ticket.availableQuantity}
          issueQuantity={ticket.issueQuantity}
          maxQuantityPerUser={ticket.maxQuantityPerUser}
          isSelected={selectedTicket === index}
          isFlexiblePrice={ticket.isFlexiblePrice}
          onSelect={() => handleSelect(index)}
          onQuantityChange={(qty) => handleQuantityChange(index, qty)}
          color="#b0e681"
  />
))}
  1. ArtistTile
<ArtistTile key={index} artist={artist} />
  1. DeleteIcon
<DeleteIcon color="#fff" height={20} width={20} />
  1. UploadIcon
<UploadIcon color="#fff" height={20} width={20} />
  1. CategoryCapsule
<CategoryCapsule  tag="Music",
  icon="",
  selectedIcon="",
  isSelected={},
  onToggle={},
  color = "#b0e681"
/>
  1. SpotifySongBar
 <SpotifySongBar
        type="playlist"
        name="My Chill Playlist"
        imageUrl="https://via.placeholder.com/50"
        link="https://open.spotify.com/playlist/abc123"
      />
  1. ImageUploader
 <ImageUploader
        className="h-[200px] rounded-[12px]"
        file={file}
        onFileChange={setFile}
        withAspectRatio={true}
      />
  1. EventGalleryUploader
<EventGalleryUploader />
  1. EventImageGallery
const mockGalleryImages = [
  "https://images.unsplash.com/photo-1521334884684-d80222895322?w=800",
  "https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=800",
  "https://images.unsplash.com/photo-1521334884684-d80222895322?w=800",
  "https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=800",
  "https://images.unsplash.com/photo-1521334884684-d80222895322?w=800",
  "https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=800",
];

<EventImageGallery images={mockGalleryImages} />
  1. ArtistAvatar
 <ArtistAvatar
        artistImage="https://picsum.photos/200/300"
        artistName="Sahil"
        color=""
  artistNameClass=""
  onClick=
      />
  1. UserDetailsCardMobile
<UserDetailsCardMobile
          collectiblesCount={mockDashUser.collectiblesCount}
          name={mockDashUser.name}
          userName={mockDashUser.userName}
          userImage={mockDashUser.userImage}
          userGender={mockDashUser.userGender}
          ticketsCount={mockDashUser.ticketsCount}
          className="w-full bg-dark-100 border border-dark-200 rounded"
        />
  1. TicketDetailsCardMobile
<TicketDetailsCardMobile
              key={index}
              id={ticket?.id}
              availableQuantity={ticket?.availableQuantity}
              image={ticket?.image}
              issueQuantity={ticket?.availableQuantity}
              ticketStatus={ticket?.ticketStatus}
              name={ticket?.name}
              onChangeStatus={(id, newStatus) => {
                alert({id, newStatus});
              }}
            />
  1. EventDetailsCardMobile
 <EventDetailsCardMobile
          event={{
            eventName: "Live Music Festival",
            startDate: "2025-05-05T10:00:00Z",
            endDate: "2025-05-05T15:00:00Z",
            location: "Mumbai, India",
          }}
          tickets={[
            {
              id: 1,
              name: "General Admission",
              image: "https://picsum.photos/50",
              issueQuantity: 234,
              availableQuantity: 23,
              ticketStatus: "sold out",
            },
            {
              id: 2,
              name: "VIP Pass",
              issueQuantity: 234,
              availableQuantity: 23,
              ticketStatus: "sold out",
              image: "",
            },
          ]}
        />
  1. AttendeesTile
<AttendeesTile
attendee={{name:"Sahil", img:"https://picsum.photos/200/300", email:"[email protected]", ticketType:"RSVP", status:"Approved"}}
className=""
textClassName="" />
  1. TabsBar
 <TabsBar
        tabChange={() => {}}
        tabs={["one", "two", "three"]}
        activeTabClassName=""
        className=""
        key={1}
        tabClassName=""
      />
  1. AttendeesCard
 <AttendeesCard
          attendeesList={attendeesList}
          className={""}
          headingClassName={""}
        />
  1. QRCode
 <QRCode value={qrData}
 className=""
  size={140}
   bgColor=""
  fgColor=""

   />
  1. EventTile
 <EventTile
        eventName={eventTileMockData.eventName}
        href={eventTileMockData.href}
        oraganiserUsername={eventTileMockData.oraganiserUsername}
  eventImg={}
  color = "#b0e681"
  className=""
  titleClassName=""
  imgClassName=""
  imgContainerClassName=""
      />
  1. TicketSoldCard
 <TicketSoldCard
        tickets={[
          { ticketName: "General Admission", sold: 45, total: 100 },
          { ticketName: "VIP", sold: 20, total: 50 },
          { ticketName: "Backstage", sold: 5, total: 10 },
        ]}
      />
  1. PastTicketCardMobile
  <PastTicketCardMobile
        createdAt={pastTikcetMockData.createdAt}
        ticketName={pastTikcetMockData.ticketName}
        ticketQuantity={pastTikcetMockData.ticketQuantity}
        eventName={pastTikcetMockData.eventName}
        eventStartDate={pastTikcetMockData.eventStartDate}
        eventEndDate={pastTikcetMockData.eventEndDate}
        eventVenue={pastTikcetMockData.eventVenue}
        eventLocation={pastTikcetMockData.eventLocation}
        eventImages={pastTikcetMockData.eventImages}
        color="#b0e681"
        onClick={() => alert("Card clicked!")}
  className=""
  cardClassName=""
  badgeClassName=""
      />
      ```
  1. TicketCardMobile
 <TicketCardMobile
        tickerPrice={pastTikcetMockData.price}
        createdAt={pastTikcetMockData.createdAt}
        eventEndDate={pastTikcetMockData.eventEndDate}
        eventImages={pastTikcetMockData.eventImages}
        eventName={pastTikcetMockData.eventName}
        eventStartDate={pastTikcetMockData.eventStartDate}
        ticketName={pastTikcetMockData.ticketName}
        ticketQuantity={pastTikcetMockData.ticketQuantity}
        eventVenue={pastTikcetMockData.eventVenue}
        eventLocation={pastTikcetMockData.eventLocation}
        color="#b0e681"
        onClick={() => alert("Card clicked!")}
        mapApiKey=""
        imgClassName=""
        className=""
      />
  1. TicketSalesChart
 const mockTicketSalesData = [
    {
      createdAt: "2025-04-01T10:00:00Z",
      attendees: "12",
    },
    {
      createdAt: "2025-04-02T12:00:00Z",
      attendees: "7",
    }
  ]

 <TicketSalesChart
 ticketData={mockTicketSalesData}
  title=""
  className=""
  titleClassName=""
  chartClassName=""
  color=""
  yTicksColor=""
  />
  1. Desktop Sidebar
<DesktopSideBar
        fanLinks={fanMenuList}
        organiserLinks={organiserMenuList}
        onChange={(checked: boolean) => setIsOrganiserMode(checked)}
        isOrganiserMode={isOrganiserMode}
        className="max-w-[200px]"
        linkClassName="py-2"
        linkTextClassName="text-sm"
        activeColor="#b0e681"
        profileMenu={profileMenu}
      />
  1. AddFeatureCard
  <AddFeatureCard
        imgSrc="/icons/plus.svg"
        title="Add Custom Feature"
        description="Use this card to highlight a new feature users can add."
        btnLabel="Add Now"
        className="bg-dark-200 hover:bg-dark-300"
        titleClassName="text-lg"
        descClassName="text-gray-400"
        btnClassName=""
        onClick={()=>alert("btn clickeds")}
      />
  1. ColorPopup
 <ColorPopup
          selectedColor="#b0e681"
          onChange={() => {}}
          className="w-full text-white"
          selectedColor,
          onChange,
          colors = [],
          label = "Color",
          dropdownClassName = "",
          triggerClassName = "",
    />
  1. AddFeatureCard
    <AddFeatureCard
          imgSrc="/icons/plus.svg"
          title="Add Custom Feature"
          description="Use this card to highlight a new feature users can add."
          btnLabel="Add Now"
          className="bg-dark-200 hover:bg-dark-300"
          titleClassName="text-lg"
          descClassName="text-gray-400"
          btnClassName=""
          onClick={() => alert("btn clickeds")}
        />
  1. VerticalDrawer
  <VerticalDrawer
        isOpen={isDrawerOpen}
        onClose={() => setIsDrawerOpen(false)}
        position="bottom"
        title = "",
        titleClassName = "",
        showCloseButton = true,
        closeButtonClassName = "",
        contentClassName = "",
      >
        //you code here
      </VerticalDrawer>
  1. TextEditor
 <TextEditor
          name="description"
          initialValue={editorContent}
          onChange={setEditorContent}
          maxLength={500}
          wrapperClassName="mb-4"
        />
  1. EventCardMobile
 <EventCardMobile
        organiserName=""
        organiserImg=""
        eventImg=""
        eventName="Testing Event"
        tags={["tag", "testing"]}
        eventLocation="New Delhi"
        eventVenue="JLN Stadium"
        eventStartDate=""
        onClick={() => alert("mobile event card clicked")}
      />
  1. EventBannerMobile
 <EventBannerMobile
        className="mx-auto my-4"
        eventImg="https://images.unsplash.com/photo-1551963831-b3b1ca40c98e"
        eventName="Sunset Beats Festival"
        organiserImg="https://randomuser.me/api/portraits/men/75.jpg"
        organiserName="DJ Avicii"
        onShareClick={() => alert("Share clicked!")}
        tags={["EDM", "Live", "Outdoor", "Festival"]}
        eventVenue="JLN Stadium, New Delhi"
        eventColor="#FF6B00"
        eventStartDate="2025-06-15T18:00:00Z"
      />
  1. VenueBar
      <VenueBar
        className={""}
        data={[
    {
      location: "delhi",
      venue: "nehru stadium",
    },
    {
      location: "chennai",
      venue: "chidambram stadium",
    },
  ]}
        isSingle={false}
        onSelect={() => alert(selectedLocation)}
      />
  1. Header
     <Header className="" navClassName="">
        <div className="w-full flex justify-center items-center">
          <h1>Stikcy Header</h1>
        </div>
      </Header>
  1. ConversionRateChart

 const sampleData = {
    purchase: {
      Day: [2],
      Week: [1, 2, 2, 3, 2, 4, 5],
      Month: [5, 6, 7, 10],
      Year: [200, 180, 190, 210, 250, 230, 220, 200, 190, 240, 260, 270],
    },
    checkout: {
      Day: [4],
      Week: [2, 3, 3, 4, 3, 5, 6],
      Month: [6, 7, 8, 9],
      Year: [100, 110, 105, 120, 130, 125, 115, 100, 95, 135, 140, 145],
    },
    visit: {
      Day: [10],
      Week: [8, 9, 10, 9, 10, 9, 10],
      Month: [10, 9, 9, 10],
      Year: [300, 320, 310, 330, 350, 340, 325, 310, 300, 360, 370, 380],
    },
  };


  <ConversionRateChart
        sampleData={sampleData}
        className={""}
        dropdownBtnClassName={""}
        ticksColor="#181818"
        dropdownOptionClassName={""}
      />
  1. TopBar
  <TopBar
        organiserName="John Doe"
        organiserImage="https://picsum.photos/200/300"
        eventName="Spring Fest 2025"
        eventStartDate="2025-05-01T10:00:00Z"
        eventEndDate="2025-05-10T18:00:00Z"
        eventImage="https://picsum.photos/200/300"
        eventLocation="Mumbai, India"
        className=""
         dateClassName=""
  locationClassName=""
  statusClassName=""
      />
  1. LinkClicksChart
<LinkClicksChart
        data={data}
        ticksColor="#b0e681"
        isLoading={false}
         className=""
  ticksColor=""
  dropdownBtnClassName=""
  dropdownOptionClassName=""
      />