Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
/ polymorphic Public archive

Polymorphic component factories for JSX frameworks

License

Notifications You must be signed in to change notification settings

chakra-ui/polymorphic

Folders and files

NameName
Last commit message
Last commit date
Jun 14, 2023
Jul 26, 2023
Oct 20, 2023
Oct 27, 2022
Oct 31, 2022
Oct 31, 2022
Oct 27, 2022
Oct 31, 2022
Apr 2, 2023
Dec 14, 2022
Dec 28, 2022
Oct 18, 2023
Oct 20, 2023
Oct 27, 2022
Nov 3, 2022
Apr 1, 2023
Oct 31, 2022

Repository files navigation

@polymorphic-factory

CodeCov MIT License Github Stars

Create polymorphic React/Preact/SolidJS/Vue components with a customizable styled function.

A polymorphic component is a component that can be rendered with a different element.

import { polymorphicFactory } from '@polymorphic-factory/{react,preact,solid,vue}'

const poly = polymorphicFactory()

const App = () => (
  <>
    <poly.div />
    <poly.main>
      <poly.section>
        <poly.div as="p">This is rendered as a p element</poly.div>
      </poly.section>
    </poly.main>
  </>
)

This monorepo uses pnpm as a package manager. It includes the following packages:

Packages

Development

Install the dependencies with pnpm:

pnpm install

To build all packages, run the following command:

pnpm run build

To execute all test suites, run the following command:

pnpm run test

You can execute npm scripts in each package with the shortcut commands:

# pnpm run <package> <command>
pnpm run react test
pnpm run solid build

Versioning

This repository uses changesets to version and publish the packages.

To create a semver bump, create a changeset with a summary of the changes made:

pnpm changeset

License

MIT © Tim Kolberger