@0xdolan/deq-react
Deq shapes as typed, tree-shakable React components.
import { RojHalfSun, DeqIcon } from "@0xdolan/deq-react";<RojHalfSun size={32} strokeWidth={1.5} absoluteStrokeWidth /><DeqIcon name="kurdish-sun" color="#ED2024" />Source: packages/react. Install with npm install @0xdolan/deq-react.
Per-shape exports
93 generated exports, one per shape, such as ArchDot, ArchDotColumn, ArrowDown. The icon list shows every shape.
Functions
DeqIcon
function DeqIcon({ name, ...props }: DeqIconByNameProps): ReactElement<unknown, string | JSXElementConstructor<any>>Any icon by catalog id: <DeqIcon name="roj-half-sun" />. It keeps every icon in the
bundle; import the named components (RojHalfSun) to tree-shake.
@throws {DeqError} UNKNOWN_SHAPE for an id that is not in the catalog.
createDeqIcon
function createDeqIcon(icon: DeqIcon, displayName: string): FunctionComponent<DeqIconProps>Make a typed component from icon data (@0xdolan/deq-icons). The generated components
use this; call it yourself for custom icon data.
Constants
packageName
const packageName: '@0xdolan/deq-react'The npm package name.
Interfaces
DeqIconByNameProps
interface DeqIconByNamePropsProps of DeqIcon: an icon picked by catalog id.
name: string: Catalog id, for exampleroj-half-sun.size?: string | number: Width and height in px, or any CSS length. Default 24.color?: string: Stroke and dot colour (CSS colour). DefaultcurrentColor.strokeWidth?: string | number: Stroke width in grid units. Default 2.absoluteStrokeWidth?: boolean: Keep the strokestrokeWidthpx wide at any numericsize. Default false.title?: string: Accessible title. Default: the English name.""marks the icon decorative.
DeqIconProps
interface DeqIconPropsProps of every Deq icon component; other SVG props pass through to the <svg>.
size?: string | number: Width and height in px, or any CSS length. Default 24.color?: string: Stroke and dot colour (CSS colour). DefaultcurrentColor.strokeWidth?: string | number: Stroke width in grid units. Default 2.absoluteStrokeWidth?: boolean: Keep the strokestrokeWidthpx wide at any numericsize. Default false.title?: string: Accessible title. Default: the English name.""marks the icon decorative.
A new version of this site is available.