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

@ostrich_development/ostrich-components

v1.1.15

Published

React components that look good out of the box and are **fully customizable through plain props**. Every component starts from a default style, and any style prop you pass is merged over it, so you only override what you need.

Readme

Ostrich Component Library for React

React components that look good out of the box and are fully customizable through plain props. Every component starts from a default style, and any style prop you pass is merged over it, so you only override what you need.

npm install @ostrich_development/ostrich-components
import { OstrichTabBar, OstrichForm } from "@ostrich_development/ostrich-components";

<OstrichTabBar tabs={["Home", "About", "Contact"]} onTabClick={(tab) => console.log(tab)} />

Works with React 18 and 19. Built with tsup.


Customizing

Every component has a default look. Anything you pass is layered on top, so you only write what you want to change.

Prop naming (same pattern everywhere)

| Pattern | Meaning | Examples | |---|---|---| | style | The component's outermost element | <OstrichButton style={{ backgroundColor: "teal" }} /> | | <part>Style | One part of the component | labelStyle, drawerStyle, menuStyle, fieldStyle, inputStyle, markerStyle | | hover<Part>Style / active<Part>Style / disabled<Part>Style | That part in a state. Active means selected / open | hoverStyle, activeLabelStyle, hoverDrawerStyle, disabledSubmitStyle | | titleStyle | Only real headings | form title, field titles, definition list title | | labelStyle | Text on a control | tab text, dropdown text, button text, option text | | captionStyle, moreTextStyle | Supporting text under a title | form fields | | onClick | Clicking the component | OstrichButton, OstCard, TabItem | | on<Thing>Click | Clicking one item inside it | onTabClick, onDrawerClick |

Data objects (tabs, drawers, dropdowns, form fields) accept the same style names for that one item: { title: "Home", labelStyle: {...}, activeStyle: {...} }. An item's own style wins over the component-wide one.

Old prop names still work (boxStyle, titleTextStyle, isActive, onSubmit...). Your editor shows them crossed out with the new name to use.

HTML attributes, classes and refs

Every component passes className, id, data-*, aria-*, extra event handlers (onKeyDown, onMouseEnter...) and ref to its outer element:

const formRef = useRef<HTMLDivElement>(null);
<OstrichForm ref={formRef} className="signup" data-testid="signup" fields={fields} />

Text inputs also take inputProps (or inputProps on a field object) for attributes on the <input> itself:

fields={[{ id: "email", type: "email", inputProps: { name: "email", autoComplete: "email" } }]}

Default styles are inline, so a className can't override a specific default property directly (inline styles beat classes). Change colors, fonts, corners and shadows with the theme (below), and anything else with the matching ...Style prop.

Theming

Every default color, the font, the corner radii and the shadows are CSS variables (--ost-*). Their fallbacks are the original look, so nothing changes until you set one. There are three ways to set them:

1. <OstrichTheme> around your app, or around one section. Set only what you want to change:

import { OstrichTheme } from "@ostrich_development/ostrich-components";

<OstrichTheme theme={{
    colors: { accent: "#2bb3a3", active: "#d6f5f1", surface: "#fafafa" },
    font: "Inter, sans-serif",
    radius: 8,                       // or { sm: 6, md: 8, lg: 12 }
}}>
    <App />
</OstrichTheme>

Themes can be nested; the inner one wins. The wrapper uses display: contents, so it doesn't change your layout.

2. Plain CSS, which also works with dark mode, Tailwind arbitrary properties and CSS modules:

:root { --ost-accent: #2bb3a3; --ost-font: Inter, sans-serif; }

@media (prefers-color-scheme: dark) {
  :root { --ost-text: #eee; --ost-surface: #2a2a2a; --ost-border: #555; --ost-card: #1e1e1e; }
}

You can also scope it with className: .sidebar { --ost-surface: #222; } → <OstrichTabBar className="sidebar" ... />.

3. Generate the CSS from a theme object, e.g. for a global stylesheet or a Next.js layout:

import { ostrichThemeCSS } from "@ostrich_development/ostrich-components";
<style>{ostrichThemeCSS(myTheme)}</style>                // :root { --ost-accent: ...; }
<style>{ostrichThemeCSS(myDarkTheme, ".dark")}</style>   // .dark { ... }

Explicit ...Style props always beat the theme.

Theme tokens

| Theme key | CSS variable | Default | Used for | |---|---|---|---| | colors.text | --ost-text | black | Text | | colors.mutedText | --ost-muted-text | grey | Field captions | | colors.softText | --ost-soft-text | #3d3d3d | Field extra text | | colors.border | --ost-border | black | Lines around tabs, dropdowns, forms | | colors.surface | --ost-surface | #efefef | Tabs, dropdowns, drawers, entries | | colors.card | --ost-card | white | Clickable cards | | colors.hover | --ost-hover | #a5a8a8 | Hovered tabs / dropdowns / drawers | | colors.active | --ost-active | #c3e2fa | Selected tab, open dropdown, picked drawer | | colors.accent | --ost-accent | #9cc6f0 | Buttons, selected options, valid status | | colors.accentBorder | --ost-accent-border | #57a5f2 | Edge of selected options / valid status | | colors.submit | --ost-submit | #8ebbfa | Form submit button | | colors.disabled | --ost-disabled | #9d9e9e | Disabled buttons | | colors.marker | --ost-marker | #bdbdbd | Unselected option bubbles, neutral status | | colors.correct / correctBorder | --ost-correct / --ost-correct-border | #a8ffad / #57f25f | Correct answers | | colors.wrong / wrongBorder | --ost-wrong / --ost-wrong-border | red / red | Wrong answers | | colors.error | --ost-error | #d32f2f | "Why is this invalid?" messages | | colors.correctText | --ost-correct-text | #2e7d32 | "Correct answer: ..." text | | colors.link | --ost-link | blue | ODef word | | colors.popup | --ost-popup | lightgrey | ODef popup | | colors.focusRing | --ost-focus-ring | rgba(0,0,255,0.3) | Focused inputs | | font | --ost-font | Gilroy, system-ui, sans-serif | All text | | radius.sm / md / lg | --ost-radius-sm / -md / -lg | 10px / 15px / 20px | Dropdowns & entries / cards & buttons / forms | | shadows.normal / soft / subtle / popup | --ost-shadow-normal / -soft / -subtle / -popup | | Cards & buttons / dropdowns / form fields / ODef popup |

Hover colors are computed from the current color, so a themed accent still darkens on hover.

Styling every part

Nothing is locked. Every piece a component draws has a default and a ...Style prop layered on top of it, and your styles are applied after the defaults (state styles like hover or pressed come last, and have their own props too).

| Component | Style props | |---|---| | OstCard | style, hoverStyle, pressedStyle; templates: contentStyle, imageAreaStyle, imageStyle, textStyle, titleStyle, captionStyle, bodyStyle, columnStyle | | OstrichButton | style, hoverStyle, pressedStyle, disabledStyle, labelStyle, captionStyle, contentStyle, imageStyle | | OstrichDropDown | style, hoverStyle, activeStyle, labelAreaStyle, labelStyle (+ hover/active), inputStyle, menuAreaStyle, menuContainerStyle, menuStyle, drawerStyle (+ hover/active), drawerLabelStyle | | OstrichTabBar | style, tabAreaStyle, tabListStyle, tabStyle (+ hover/active), labelStyle (+ hover/active), drawer styles for dropdown tabs | | OstrichForm | style, headerStyle, titleStyle, bodyStyle, fieldStyle, fieldContentStyle, titleRowStyle, fieldTitleStyle, bubbleStyle, captionStyle, moreTextStyle, detailsStyle, inputStyle, focusedInputStyle, optionStyle, markerStyle, selectedMarkerStyle, optionLabelStyle, fieldButtonStyle, messagesStyle, errorStyle, answerStyle, submitStyle, disabledSubmitStyle, submitLabelStyle, reviewStyle | | Every field (FormText, FormMultipleChoice, ...) | style, contentStyle, titleRowStyle, titleStyle, bubbleStyle, bubbleAreaStyle, captionStyle, moreTextStyle, detailsStyle, imageStyle, imageCardStyle, messagesStyle, errorStyle, answerStyle | | FormText | + inputStyle, focusedInputStyle | | FormMultipleText | + inputRowStyle, inputAreaStyle, inputStyle, buttonAreaStyle, buttonStyle, buttonHoverStyle, entryRowStyle, entryStyle, entryHoverStyle | | FormMultipleChoice | + optionsStyle, optionGroupStyle, optionRowStyle, optionStyle, markerAreaStyle, markerStyle, selectedMarkerStyle, optionLabelAreaStyle, optionLabelStyle, tabStyle (+ hover/active), tabLabelStyle (+ hover/active) | | FormDropDownText | + inputStyle, drawerStyle, hoverDrawerStyle, menuStyle, and dropdownProps for anything else on the inner dropdown | | OstrichSelectionBox | style, markerAreaStyle, markerStyle (+ selected / correct / wrong), labelAreaStyle, labelStyle | | ODef | style (the word), popupStyle, contentStyle, rowStyle, termStyle, definitionStyle | | DefinitionList / DefinitionRow | style, titleStyle, rowStyle, termStyle, definitionStyle, termTextStyle, definitionTextStyle |

In forms, any of a field component's props can be passed to every field with fieldProps={{ optionRowStyle: {...}, entryStyle: {...} }}, or to one field with fieldProps on its field object. Field objects also accept the inner-piece styles directly ({ id: "q1", type: "MC", bubbleStyle: {...} }). A field's own setting beats the form-wide one.

Props meant for a different component (e.g. a form-wide optionRowStyle reaching a text field) are ignored instead of leaking into the HTML.

Accessibility

Everything is usable with a keyboard and announced properly by screen readers, with no setup:

| Component | Keyboard | Screen readers hear | |---|---|---| | OstrichButton, clickable OstCard | Tab to it, Enter / Space to press | A button (disabled buttons are skipped by Tab) | | OstrichTabBar | Tab into the bar, ← → / Home / End to move, Enter / Space to pick | A tab list, which tab is selected | | OstrichDropDown | Enter / Space / ↓ to open, ↑ ↓ to move, Enter to pick, Esc to close | A button that opens a list, the highlighted option | | Type-ahead fields (isInput, FormDropDownText) | Type to filter, ↑ ↓ to move, Enter to pick, Esc to close | A combo box with suggestions | | Form fields | Normal typing / Tab | Each input is named by its field title and described by its caption; wrong answers are flagged | | Multiple choice | Tab between options, Space to pick (clicking the option text works too) | Radio buttons (single choice) or checkboxes (multiple) | | Status bubble | — | "Complete", "Not complete", "Correct" or "Incorrect" | | reviewOnSubmit score | — | Read out when it appears | | ODef | Tab to the word, Enter to open, Esc to close | A button that opens a dialog |

What you should still provide:

  • A name for things without visible text: aria-label on a tab bar (<OstrichTabBar aria-label="Main" />) and on image-only buttons (or set label, which is used for the image's alt text).
  • Image descriptions: imageAlt on OstCard, imgAlt on OstrichButton, and imgAlt on form field objects that use img. Leave them out for purely decorative images.

Form validation & answers

Why is this invalid? Every field explains itself under the input once the person leaves it (not while they're still typing). Clicking a greyed-out Submit shows every field's message at once, so people can see what's missing.

Where the explanation comes from, first match wins:

| Situation | Message | |---|---| | The browser rejects it (type: "email", "number", "url", or inputProps like pattern, minLength) | The browser's own message, e.g. Please include an '@' in the email address. | | validResponse is a function that returns a string | That string | | The field has invalidMessage | That text | | A required field is empty | This field is required. (or the field's requiredMessage) | | Anything else that fails | This answer isn't valid. | | Multiple choice / multi-text below min | Pick at least 2. / Add at least 2 entries. | | Trying to go past limit | You can pick up to 3. / You can add up to 3 entries. | | Type-ahead value that isn't one of the options | Pick one of the suggestions. |

{ id: "age", type: "text", title: "Age",
  validResponse: (v) => /^[0-9]+$/.test(v) || "Age must be a number" }   // true = valid, string = why not

Optional fields (required: false) never complain about being empty. Turn messages off with showErrors={false} on the form, and style them with errorStyle (form-wide or per field).

Showing the right answer. Add showsAnswer to the form. After a submission, any field with a correctResponse that was answered wrong reveals it:

  • Text, multi-text and type-ahead fields show Correct answer: Paris under the input.
  • Multiple choice turns the right option(s) green and a wrong pick red, and screen readers hear "(correct answer)" / "(wrong answer)".

It updates live: when the person fixes the answer, the reveal disappears. Turn it off for one field with showsAnswer: false on that field. Style it with answerStyle, and change the wording with answerLabel (default "Correct answer:"). It pairs well with allowResubmission.

Status bubbles after submitting. Before a submission the bubble is blue once a field is valid. After a submission, any field with a correctResponse turns green if it's right and red if it's wrong, and updates live if the person edits it. Fields without a correctResponse stay blue.


Code examples and workspaces

CodeExample shows read-only code with syntax colors, a Copy button, optional line numbers, highlighted lines, language tabs and a live preview. CodeWorkSpace is the editable version: Tab indents, Enter keeps the indentation, Reset goes back to the starting code, and Run executes it.

import { CodeExample, CodeWorkSpace } from "@ostrich_development/ostrich-components";

// One language
<CodeExample language="javascript" code={`console.log("Hello!")`} />

// Several, with tabs
<CodeExample lineNumbers highlightLines={[2]} languages={{ JavaScript: jsCode, Python: pyCode, Java: javaCode, "C#": csCode }} />

// With a live preview above the code
<CodeExample code={`<OstCard>Hi</OstCard>`}>
    <OstCard>Hi</OstCard>
</CodeExample>

// An exercise: JavaScript runs in the browser, and the output is checked
<CodeWorkSpace
    defaultValue={`const total = 2 + 2\nconsole.log(total)`}
    expectedOutput="4"
    onResult={(result) => console.log(result.isCorrect, result.output)}
/>
  • Languages colored: JavaScript, JSX, TypeScript, Python, Java, C#, HTML, CSS, JSON (and "text" for none). Names like "js", "py" or "C#" work too.
  • Running code: JavaScript runs in a Web Worker, so it can't touch your page, and a run longer than timeout (3 s) is stopped, so an endless loop can't freeze anything. Other languages need your own onRun(code, language), which can send the code to a server and return the text to show.
  • Grading: expectedOutput compares what was printed; check(result) returns true, false or a sentence saying what's wrong. Ctrl/Cmd + Enter runs.
  • Styling: every part has a style prop (headerStyle, codeStyle, inputStyle, outputStyle, lineNumberStyle, highlightLineStyle, runButtonStyle...), tokenStyles restyles each kind of code ({ keyword: { color: "orange" } }), and the theme has code colors (codeBackground, codeText, codeKeyword, codeString, codeComment...) plus codeFont.

Development

| Command | What it does | |---|---| | npm install | Install dependencies (run after pulling or after package.json changes) | | npm run dev | Rebuild dist/ on every save | | npm run build | Build dist/ once (ESM, CommonJS and type declarations) | | npm run typecheck | Check types without building |

Try changes in a real app before publishing

From this folder:

npm run build
npm pack                       # creates ostrich_development-ostrich-components-X.Y.Z.tgz

Then in your app:

npm install /path/to/OstrichComponentsReact/ostrich_development-ostrich-components-X.Y.Z.tgz

This installs exactly what npm would publish. Delete the .tgz afterwards (don't commit it). To go back to the published version, run npm install @ostrich_development/ostrich-components@latest in the app.


🚀 Publishing a new version (checklist)

Short version: commit everything → npm version patch → npm publish → git push --follow-tags

One-time setup (new computer)

npm login                      # opens the browser to sign in to npmjs.com
npm whoami                     # should print your npm username

Your npm account must be a member of the ostrich_development organization on npmjs.com.

Every release

1. Start clean and up to date

git pull
npm install
git status                     # must show "nothing to commit"; commit or stash first

npm version (step 3) refuses to run if there are uncommitted changes.

2. Make sure it builds

npm run typecheck
npm run build

npm publish runs both of these automatically too (the prepublishOnly script), so a broken build can't be published by accident. Running them now just catches problems before you bump the version.

3. Bump the version. Pick one:

npm version patch              # 1.1.11 → 1.1.12  bug fixes only
npm version minor              # 1.1.11 → 1.2.0   new features / new props, nothing breaks
npm version major              # 1.1.11 → 2.0.0   anything that could break an existing app

This updates package.json, makes a git commit, and creates a tag like v1.1.12.

4. Preview what will be uploaded (optional but recommended)

npm run release:dry

You should see only dist/, package.json, readme.md and LICENSE. Nothing is uploaded.

5. Publish

npm publish

If your account has two-factor auth, npm will ask for a code (or add --otp=123456).

6. Push the version commit and tag to GitHub

git push --follow-tags

7. Check it worked

npm view @ostrich_development/ostrich-components version

It should print the new version. In your apps, run npm install @ostrich_development/ostrich-components@latest.

When something goes wrong

| Error | Fix | |---|---| | ENEEDAUTH / need auth | Run npm login | | 403 ... cannot publish over the previously published versions | That version number is taken. Run npm version patch again and publish | | 402 Payment Required / must be public | First publish of a scoped package: npm publish --access public (only needed once) | | 403 Forbidden (not a version issue) | Your npm user isn't in the ostrich_development org, or you're logged into the wrong account (npm whoami) | | Git working directory not clean | Commit or stash your changes, then rerun npm version | | EOTP / one-time password required | npm publish --otp=<code from your authenticator> | | Published, but the app doesn't see the change | In the app: npm install @ostrich_development/ostrich-components@latest, then restart the dev server | | Published something broken | Publish a fixed patch right away. You can also run npm deprecate @ostrich_development/[email protected] "broken, use X.Y.Z+1". Avoid npm unpublish: it only works within 72 hours and that version number can never be reused |


Changelog

Unreleased (suggest publishing as 2.0.0, since some defaults changed)

  • Changed: multiple choice allows one answer by default, in forms too (forms used to allow many). Set singleOption: false, or a limit above 1, to allow several.

  • Changed: answers are checked against both the form's correctResponse answer key (first) and the field's own correctResponse / correctValue; matching either counts as correct, and revealed answers highlight both. Numbers and text match, so 175 and "175" are the same answer.

  • Large cleanup: styles are computed during render, shared helpers replace duplicated code, and strict TypeScript passes.

  • Type declarations (index.d.ts) now ship with the package.

  • Fixed: form onSubmit now receives (values, fields, previousValues), the submit button enables when the form is valid, reviewOnSubmit grades correctly, string and number tabs work, the dropdown drawerStyle applies, multiple-choice limit works, and more.

  • New: pastAnswerData, showWrongAnswers and allowResubmission on OstrichForm. OstrichButton and the types are exported.

  • Consistent prop names across all components (see Customizing). Old names still work but are deprecated.

  • Every component accepts className, id, data-*, aria-*, extra event handlers and ref. Text inputs accept inputProps.

  • New: OstrichButton disabled, hoverStyle, onClick; dropdown menuStyle, drawerLabelStyle, onInputChange; per-field fieldStyle, titleStyle, inputStyle on form field objects.

  • Theming: every default color, font, radius and shadow is a CSS variable. New <OstrichTheme>, ostrichThemeCSS(), themeToCSSVars() and DEFAULT_THEME.

  • The font now falls back to the system font (instead of the browser's serif default) when Gilroy isn't installed.

  • Accessibility: keyboard support and screen-reader roles/labels for every component (see Accessibility).

  • Fixed: a form field's img never actually showed up; it now renders (with imgAlt).

  • Fields explain why they're invalid (browser messages, validator strings, invalidMessage, requiredMessage, min/limit messages). Clicking a disabled Submit reveals all of them.

  • After a submission, status bubbles turn green (right) / red (wrong) for fields with a correctResponse (showWrongAnswers is no longer needed for this).

  • New showsAnswer on forms: reveals the correctResponse after a wrong submission (green/red options, "Correct answer:" line).

  • OstrichForm takes a whole-form answer key: correctResponse={{ 1: ["String"], 2: ["Integer"] }} (a field's own correctResponse wins).

  • Multiple choice takes a controlled value, and allowDeselect (tab-style options stay picked when clicked again, so they work as menus).

  • OstrichTabBar takes openOnHover for its dropdown tabs. Field objects accept minLength as another name for min.

  • Fixed: a validResponse that expects a string no longer crashes the form on first render; a validator that throws counts as invalid.

  • Every inner piece of every component has a ...Style prop (see Styling every part); press effects are pressedStyle; forms take fieldProps.

  • Fixed: a form opened from pastAnswerData with reviewOnSubmit now shows its "x / total correct" score right away.

  • Fixed: markerType="box" now draws a square-cornered box (it was a 50px circle), the same size as the bubble.

  • Fixed: multiple-choice labels no longer overlap in narrow spaces; options move down a line instead.

  • Fixed: a standalone FormMultipleChoice now reads singleOption and itemsPerRow from fieldObj when the props aren't given.

  • New: CodeExample (read-only code with colors, tabs, copy and preview) and CodeWorkSpace (editable code that can run JavaScript and check the output). The theme gains code colors and codeFont.

  • Fixed: dropdown labels (and the search box placeholder) are now vertically centered. Override with style={{ justifyContent: "flex-start" }}.

  • Fixed: multiple-choice tabs (template: "tabs") are all the same height; when one tab's text wraps, every tab grows to match.

  • Breaking:

    • Forms lock after one submission unless allowResubmission is set.
    • Inactive buttons ignore clicks.
    • { tag, value } multiple-choice options store value.
    • FormMultipleChoice now applies its style prop (1.x ignored it).
    • The form Submit button is 25% wide as its defaults always intended (1.x accidentally rendered it full width; pass submitStyle={{ width: '100%' }} to keep that look).
    • A validResponse function that returns a string now means invalid, because … (it used to count as valid).
    • OstrichButton's inactiveStyle/disabledStyle is now layered over style instead of replacing it.

1.0.0

  • First release (React 18).