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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ra-compact-ui

v3.3.0

Published

Enhanced styling components for [`react-admin`](https://github.com/marmelab/react-admin), written in TypeScript.

Readme

ra-compact-ui

Enhanced styling components for react-admin, written in TypeScript.

No extra dependencies are required except the ones react-admin is already using.

Why use?

  • reduces styling boilerplate code
  • eases layout customizations
  • maintains native usage of built-in react-admin components
  • full TypeScript support with exported interfaces

npm version npm downloads GitHub license PRs Welcome minzipped size styled with prettier

Compatibility

| ra-compact-ui | react-admin | React | |---------------|-------------|---------| | 3.x | ^5.0.0 | ^18.0.0 | | 1.x | ^4.2.7 | ^17 / ^18 |

Installation

npm install ra-compact-ui
# or
yarn add ra-compact-ui

Peer Dependencies

  • react ^18.0.0
  • react-dom ^18.0.0
  • react-admin ^5.0.0
  • @mui/material ^5.x
  • @mui/icons-material ^5.x
  • @mui/system ^5.x

Components

ShowSplitter

A two-column split layout for Show views. Pass different layouts to leftSide and rightSide.

import { ShowSplitter } from 'ra-compact-ui'

const StaffShow = () => (
    <Show component="div">
        <ShowSplitter
            leftSideProps={{ md: 4 }}
            rightSideProps={{ md: 8 }}
            leftSide={
                <SimpleShowLayout>
                    <TextField source="full_name" />
                    <TextField source="email" />
                </SimpleShowLayout>
            }
            rightSide={
                <TabbedShowLayout>
                    <Tab label="Overview">
                        <TextField source="description" />
                    </Tab>
                </TabbedShowLayout>
            }
        />
    </Show>
)

Override the default grid proportions and container components using leftSideProps and rightSideProps. These are passed directly to MUI's Grid component.

<ShowSplitter
    leftSideProps={{
        md: 4,
        component: 'div',
    }}
    rightSideProps={{
        md: 8,
    }}
    leftSide={...}
    rightSide={...}
/>

CompactChipField

A wrapper around react-admin's ChipField that maps record values to per-value styling options (color and icon).

import { CompactChipField } from 'ra-compact-ui'
import CheckCircleIcon from '@mui/icons-material/CheckCircle'
import HourglassEmptyIcon from '@mui/icons-material/HourglassEmpty'
import AutorenewIcon from '@mui/icons-material/Autorenew'

<CompactChipField
    source="status"
    options={{
        Pending: { color: 'warning', icon: <HourglassEmptyIcon /> },
        InProgress: { color: 'info', icon: <AutorenewIcon /> },
        Done: { color: 'success', icon: <CheckCircleIcon /> },
    }}
/>

Props:

| Prop | Type | Default | Description | |-----------|----------------------------------|-----------|-------------| | source | string | required | The record property to display | | options | Record<string, ChipOption> | required | Map of values to { color, icon } | | variant | 'filled' \| 'outlined' \| 'light' | 'light' | Chip display variant | | size | 'small' \| 'medium' | 'small' | Chip size | | empty | ReactElement \| null | null | Fallback when value is missing | | sx | SxProps<Theme> | - | Additional MUI sx overrides |

Variants:

  • filled - solid background with white text
  • outlined - transparent background with colored border and text
  • light - transparent background tinted with the color at 12% opacity, colored text (default)

Colors: Accepts MUI palette keys ('primary', 'success', 'error', etc.) or any CSS color string ('#ff5722', 'tomato', 'rgb(255, 0, 0)').

AvatarField

Displays a record's image as a MUI Avatar with size optimization.

import { AvatarField } from 'ra-compact-ui'

<AvatarField source="avatar_url" altSource="full_name" size="50" />

ChipArrayField

Renders an array field as a list of MUI Chips.

import { ChipArrayField } from 'ra-compact-ui'

<ChipArrayField source="tags" />

FullNameField

Combines an AvatarField with a full name display (firstName + lastName).

import { FullNameField } from 'ra-compact-ui'

<FullNameField size="25" />

Running the Demo

The demo app uses Vite and points directly at the library source via a Vite alias, so changes are reflected instantly with HMR.

yarn start-demo

Development

yarn install          # Install dependencies
yarn build            # Build the library (tsc)
yarn test             # Run tests (vitest)
yarn lint             # Lint with ESLint
yarn start-demo       # Start the demo app

About Author

An enthusiast in love with building software who likes to call it "the grown up's LEGO".

If you enjoy the library and want to support me, you can always