Props
Every prop accepted by Jedd Icons React components.
Every icon component accepts the props below plus all standard SVG
attributes (className, onClick, style, aria-*, focusable, …).
Prop
Type
Defaults at a glance
| Prop | Default | Notes |
|---|---|---|
size | 24 | px when numeric |
color | currentColor | inherits text color |
strokeWidth | 2 | |
absoluteStrokeWidth | false | see below |
To change these defaults for every icon, wrap your app in JeddProvider — see
Global styling.
Both packages share the same styling model: four knobs — size, color,
strokeWidth, and absoluteStrokeWidth. Only the surface syntax differs
(React props vs createElement options).
How color works
color sets the stroke attribute; the interior stays transparent
(fill: none).
How absoluteStrokeWidth works
Normally a stroke scales with the icon: a strokeWidth of 2 looks thicker at
size={48} than at size={24}. With absoluteStrokeWidth, the rendered stroke
is computed as:
renderedStrokeWidth = strokeWidth × 24 / sizeSo the visual thickness matches your strokeWidth value at any size — handy
when icons of different sizes need to read as the same weight.
CSS hooks
Icons rendered by the React components or by createIcons carry two class
names you can target globally: jedd (on every icon) and jedd-<name> (per
icon, in kebab-case). Any class name you pass is appended to these.
createElement only receives the icon's data, not its name, so it adds no
classes: pass your own with the class option.
.jedd {
vertical-align: middle;
}
.jedd-arrow-down-left {
/* style one specific icon */
}You can also set defaults for every icon this way, for example a lighter stroke:
.jedd {
stroke-width: 1.5;
}CSS takes precedence over the attributes the options set, so where a rule like
this applies, setting strokeWidth on a single icon has no effect.
To keep the stroke the same visual thickness at any size with CSS — the
equivalent of absoluteStrokeWidth, but also when the size comes from CSS
width / height — add vector-effect to the icon's shapes:
.jedd * {
vector-effect: non-scaling-stroke;
}Exported types
import type {
IconProps,
JeddIcon,
JeddProviderProps,
IconNode,
} from "@jedd-icons/react";IconProps— the props every icon accepts (extendsSVGProps).JeddIcon— the type of an icon component (ForwardRefExoticComponent).JeddProviderProps— the propsJeddProvideraccepts.IconNode— the raw icon geometry tuple.