Skip to content

About

A library of high-quality primitives that extend Solid reactivity.

Topics

Resources

Contributing

Security policy

Stars

1.6k stars

Watchers

9 watching

Forks

Latest commit

 

History

5,377 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solid Primitives 2.0

Solid Primitives 2.0

website pnpm tested with vitest

Solid Primitives is a project dedicated to building high-quality, community-contributed primitives for Solid 2.0. Every utility is thoroughly tested, continuously maintained, and reviewed against a consistent quality bar before it lands in the repository. Our aim is to extend Solid's primary and secondary primitives with a well-rounded set of tertiary primitives. While Solid Primitives isn't officially maintained by the SolidJS Core Team, it's managed by members of the SolidJS core and ecosystem teams. This separation lets the core library iterate independently while keeping Solid Primitives in sync with where Solid is headed.

Visit https://primitives.solidjs.community for documentation and demos for each primitive.

Philosophy

Solid Primitives wraps client- and server-side functionality in a fully reactive API layer. The more deeply rooted these tertiary primitives become, the more they serve as a foundation within Solid's broader ecosystem. Building on well-tested, widely reused foundations makes the applications built on top of them smaller (through aggregate tree-shaking), more readable (through concise, consistent APIs), and more stable (through managed testing and maintenance).

Solid 2.0

The next branch and all packages published under the next dist-tag target Solid.js 2.0 (solid-js@^2.0.0). Solid 2.0 introduces a new async reactivity model, updated control-flow primitives, and breaking API changes that affect every package in this library.

Every package in this release has been migrated to the new 2.0 APIs and is incompatible with Solid 1.x, with two exceptions: fetch and resource still target Solid 1.x. See the migration guide for what changed in each package. If you are still on Solid 1.x, use the latest stable releases from the main branch.

What changed

  • Async reactivity — primitives that previously returned Resource or used createResource internally now expose plain signal accessors that throw NotReadyError on pending state, integrating with <Loading> and <Errored> boundaries.
  • use: directives removed — directive-based APIs (e.g. use:fileUploader) have been replaced with ref callback factories (ref={fileUploader(opts)}).
  • isServer import path — moved from solid-js/web to @solidjs/web.
  • Split effects — all createEffect calls use the Solid 2.0 two-argument compute/apply form to avoid stale reads.
  • Peer dependencies — migrated packages require solid-js@^2.0.0 and @solidjs/web@^2.0.0.

See the migration guide and the CHANGELOG of each individual package for a full list of breaking changes.

Primitives Catalogue

Name Stage Primitives Size NPM Solid 2

Inputs

a11y STAGE createFormControl
createFormControlInput
FormControlContext
useFormControl
makeAnnounce
createAnnounce
createReducedMotion
SIZE VERSION ✓
active-element STAGE createActiveElement SIZE VERSION ✓
focus STAGE autofocus
createAutofocus
createFocusTrap
createFocusRestore
createFocusGroup
makeFocusListener
createFocusSignal
SIZE VERSION ✓
input-mask STAGE createInputMask
createMaskPattern
SIZE VERSION ✓
keyboard STAGE useKeyDownEvent
useKeyDownList
useCurrentlyHeldKey
useKeyDownSequence
createKeyHold
createShortcut
SIZE VERSION ✓
list-state STAGE createListState
createMultiSelectListState
SIZE VERSION ✓
mouse STAGE createMousePosition
createPositionToElement
SIZE VERSION ✓
pointer STAGE createPointerListeners
createPerPointerListeners
createPointerPosition
createPointerList
SIZE VERSION ✓
scroll STAGE createScrollPosition
useWindowScrollPosition
createPreventScroll
SIZE VERSION ✓
selection STAGE createSelection SIZE VERSION ✓

Utilities

analytics STAGE makeAnalytics
createAnalytics
AnalyticsProvider
useAnalytics
makeAnalyticsGuard
createAnalyticsGuard
createServerPlugin
SIZE VERSION ✓
controlled-props STAGE createControlledProp SIZE VERSION ✓
cursor STAGE makeBodyCursor
makeElementCursor
createBodyCursor
createElementCursor
createDragCursor
cursorRef
SIZE VERSION ✓
date STAGE createDate
createDateNow
createTimeDifference
createTimeDifferenceFromNow
createTimeAgo
createCountdown
createCountdownFromNow
SIZE VERSION ✓
event-bus STAGE createEventBus
createEmitter
createEventHub
createEventStack
SIZE VERSION ✓
event-dispatcher STAGE createEventDispatcher SIZE VERSION ✓
flux-store STAGE createFluxStore
createFluxStoreFactory
createActions
createAction
SIZE VERSION ✓
history STAGE createUndoHistory SIZE VERSION ✓
i18n STAGE flatten
resolveTemplate
resolveRichTemplate
richText
translator
missingKeyAsTemplate
scopedTranslator
chainedTranslator
SIZE VERSION ✓
platform STAGE List of variables SIZE VERSION ✓
promise STAGE promiseTimeout
raceTimeout
until
untilAll
untilAny
retry
changed
SIZE VERSION ✓
props STAGE combineProps
combineHandlers
filterProps
partitionProps
SIZE VERSION ✓
queue STAGE makeQueue
createQueue
makePriorityQueue
createPriorityQueue
createTaskQueue
createConcurrentTaskQueue
SIZE VERSION ✓
scheduled STAGE debounce
throttle
scheduleIdle
leading
createScheduled
leadingAndTrailing
SIZE VERSION ✓
script-loader STAGE createScriptLoader SIZE VERSION ✓
share STAGE createSocialShare
createWebShare
makeWebShare
SIZE VERSION ✓

Animation

animation STAGE makeAnimate
createAnimate
makeScrollAnimation
createScrollAnimation
makeViewAnimation
createViewAnimation
makeFlip
makeStagger
createStagger
makeAnimationGroup
createAnimationGroup
makeMotionPath
createMotionPath
makeSequence
createPresenceAnimation
SIZE VERSION ✓
presence STAGE createPresence SIZE VERSION ✓
raf STAGE createRAF
createMs
targetFPS
createCallbacksSet
useGlobalRAF
createScheduledLoop
SIZE VERSION ✓
spring STAGE createSpring
createDerivedSpring
SIZE VERSION ✓
transition-group STAGE createSwitchTransition
createListTransition
SIZE VERSION ✓
tween STAGE createTween SIZE VERSION ✓

Reactivity

async STAGE fromStream
fromJSONStream
makeAbortable
createAbortable
makeRetrying
createAggregated
SIZE VERSION ✓
controlled-signal STAGE createControllableSignal
createControllableBooleanSignal
createControllableArraySignal
createControllableSetSignal
createToggleState
SIZE VERSION ✓
deep STAGE trackDeep
trackStore
captureStoreUpdates
SIZE VERSION ✓
destructure STAGE destructure SIZE VERSION ✓
lifecycle STAGE createIsMounted
isHydrated
onElementConnect
SIZE VERSION ✓
map STAGE ReactiveMap
ReactiveWeakMap
SIZE VERSION ✓
memo STAGE createLatest
createLatestMany
createWritableMemo
createLazyMemo
createPureReaction
createMemoCache
createReducer
SIZE VERSION ✓
mutable STAGE createMutable
modifyMutable
SIZE VERSION ✓
resource STAGE createAggregated
createDeepSignal
makeAbortable
createAbortable
makeCache
makeRetrying
SIZE VERSION
rootless STAGE createSubRoot
createCallback
createDisposable
createSharedRoot
createRootPool
SIZE VERSION ✓
set STAGE ReactiveSet
ReactiveWeakSet
union
intersection
difference
symmetricDifference
readonlySet
SIZE VERSION ✓
signal-builders STAGE push
filter
sort
map
get
merge
update
add
clamp
template
SIZE VERSION ✓
sortable STAGE ascending
descending
by
combine
reverse
makeSorted
createSorted
sortedIndex
sortedIndexBy
insertSorted
createSortedIndex
createSortedProjection
SIZE VERSION ✓
state-machine STAGE createMachine SIZE VERSION ✓
static-store STAGE createStaticStore
createDerivedStaticStore
SIZE VERSION ✓
trigger STAGE createTrigger
createTriggerCache
SIZE VERSION ✓

Display & Media

audio STAGE makeAudio
makeAudioPlayer
createAudio
SIZE VERSION ✓
bounds STAGE createElementBounds SIZE VERSION ✓
devices STAGE createDevices
createMicrophones
createSpeakers
createCameras
SIZE VERSION ✓
filesystem STAGE createFileSystem
createSyncFileSystem
createAsyncFileSystem
makeNoFileSystem
makeNoAsyncFileSystem
makeVirtualFileSystem
makeWebAccessFileSystem
makeNodeFileSystem
makeTauriFileSystem
makeChokidarWatcher
rsync
SIZE VERSION ✓
idle STAGE createIdleTimer SIZE VERSION ✓
intersection-observer STAGE createIntersectionObserver
createViewportObserver
createVisibilityObserver
SIZE VERSION ✓
media STAGE makeMediaQueryListener
createMediaQuery
createBreakpoints
usePrefersDark
SIZE VERSION ✓
page-utilities STAGE createPageVisibility
usePageVisibility
makePageLeave
createPageLeaveBlocker
SIZE VERSION ✓
resize-observer STAGE createResizeObserver
createWindowSize
createElementSize
SIZE VERSION ✓
styles STAGE createRemSize SIZE VERSION ✓
video STAGE makeVideo
makeVideoPlayer
createVideo
createVideoPlayer
makeVideoFrameCallback
createVideoFrameCallback
SIZE VERSION ✓

Browser APIs

broadcast-channel STAGE makeBroadcastChannel
createBroadcastChannel
SIZE VERSION ✓
clipboard STAGE copyClipboard
writeClipboard
createClipboard
SIZE VERSION ✓
event-listener STAGE createEventListener
createEventSignal
createEventListenerMap
WindowEventListener
DocumentEventListener
SIZE VERSION ✓
event-props STAGE createEventProps SIZE VERSION ✓
favicon STAGE makeFavicon
createFavicon
makeFaviconAnimation
createFaviconAnimation
makeFaviconBadge
createFaviconBadge
makeFaviconScheme
createFaviconScheme
makeFaviconProgress
createFaviconProgress
FaviconLink
SIZE VERSION ✓
fullscreen STAGE makeFullscreen
createFullscreen
fullscreen
SIZE VERSION ✓
geolocation STAGE makeGeolocation
makeGeolocationWatcher
createGeolocation
createGeolocationWatcher
createDistance
createWithinRadius
SIZE VERSION ✓
interaction STAGE makeInteractOutside
interactOutside
createInteractOutside
ariaHideOutside
createHideOutside
SIZE VERSION ✓
mediastream STAGE createStream
createAmplitudeStream
createAmplitudeFromStream
createMediaPermissionRequest
createScreen
SIZE VERSION ✓
mutation-observer STAGE createMutationObserver SIZE VERSION ✓
notification STAGE isNotificationSupported
makeNotification
createNotification
createNotificationPermission
SIZE VERSION ✓
permission STAGE createPermission SIZE VERSION ✓
storage STAGE makePersisted
cookieStorage
tauriStorage
multiplexStorage
storageSync
messageSync
wsSync
multiplexSync
addClearMethod
addWithOptionsMethod
makeObjectStorage
SIZE VERSION ✓
timer STAGE makeTimer
createTimer
createTimeoutLoop
createPolled
createIntervalCounter
SIZE VERSION ✓
upload STAGE createFilePicker
createDropzone
dropzone
createFileUploader
fileSender
fileUploader
SIZE VERSION ✓
url STAGE createLocationState
useSharedLocationState
updateLocation
setLocationFallback
createURL
createURLRecord
ReactiveURL
createSearchParams
createLocationSearchParams
useSharedLocationSearchParams
getSearchParamsRecord
ReactiveSearchParams
SIZE VERSION ✓
workers STAGE createWorker
createWorkerPool
createWorkerQuery
createReactiveWorker
workerScope
SIZE VERSION ✓

Network

connectivity STAGE createConnectivitySignal SIZE VERSION ✓
cookies STAGE createServerCookie
createUserTheme
getCookiesString
SIZE VERSION ✓
fetch STAGE createFetch SIZE VERSION
graphql STAGE createGraphQLClient
createGraphQLMutation
SIZE VERSION ✓
sse STAGE makeSSE
createSSE
makeSSEWorker
SIZE VERSION ✓
websocket STAGE makeWS
createWS
createWSState
createWSMessage
makeReconnectingWS
createReconnectingWS
makeHeartbeatWS
wsMessageIterable
createWSData
createWSStore
SIZE VERSION ✓

Control Flow

context STAGE createContextProvider
createOptionalContextProvider
createLayeredContext
MultiProvider
SIZE VERSION ✓
jsx-tokenizer STAGE createTokenizer
createToken
createObjectToken
resolveTokens
isToken
SIZE VERSION ✓
keyed STAGE keyArray
Key
Entries
MapEntries
SetValues
SIZE VERSION ✓
list STAGE listArray
List
SIZE VERSION ✓
match STAGE MatchTag
MatchValue
SIZE VERSION ✓
range STAGE createNumericRange
repeat
mapRange
indexRange
Repeat
IndexRange
SIZE VERSION ✓
refs STAGE mergeRefs
resolveElements
resolveFirst
Ref
Refs
SIZE VERSION ✓

UI Patterns

drag-drop STAGE makeDraggable
makeDroppable
makeNativeDroppable
createDraggable
createDroppable
createNativeDroppable
createSortable
createDragContext
closestCenter
closestCorners
rectIntersection
pointerWithin
SIZE VERSION ✓
form STAGE createForm
toFormData
createFormResetListener
createFormControl
createFormControlInput
FormControlContext
useFormControl
SIZE VERSION ✓
marker STAGE createMarker SIZE VERSION ✓
masonry STAGE createMasonry SIZE VERSION ✓
pagination STAGE createPagination
createSegment
createInfiniteScroll
SIZE VERSION ✓
virtual STAGE createVirutalList
VirtualList
SIZE VERSION ✓

Sensors

orientation STAGE makeOrientation
createOrientation
SIZE VERSION ✓
sensors STAGE makeAccelerometer
createAccelerometer
makeGyroscope
createGyroscope
makeSensor
createSensor
makeCompass
createCompass
makeBattery
createBattery
SIZE VERSION ✓
vibrate STAGE isVibrationSupported
makeVibrate
createVibrate
frequencyToPattern
makePulse
createPulse
SIZE VERSION ✓

Utilities

The @solid-primitives/utils package provides shared helpers used across the library.

shallowArrayCopy shallowObjectCopy shallowCopy withArrayCopy
withObjectCopy withCopy push drop
dropRight filterOut filter sort
sortBy map slice splice
fill concat remove removeItems
flatten filterInstance filterOutInstance omit
pick split merge get
update add substract multiply
divide power clamp json
ndjson lines number safe
pipe wrapSetter parseColor normalizeColor
tryParseColor isValidColor detectColorFormat getColorChannels
normalizeHue colorToOKLCH lighten darken
saturate desaturate complement mix
contrastRatio isReadable colorScale perceptualColorScale
COLOR_INTL_TRANSLATIONS

Build & Exports

Each package exposes its raw TypeScript source via a custom @solid-primitives/source export condition. This lets tests, the playground, and cross-package imports inside the monorepo resolve directly to .ts files without a build step, while external consumers always receive the compiled dist/ output.

See EXPORTS.md for a full explanation of how this works and why we use it.

Contributing

Contributions are what make this project possible. Solid Primitives welcomes pull requests, bug reports, and feature proposals from the community.

Please read CONTRIBUTING.md for details on the submission process, coding standards, and the stage-based review pipeline all new primitives go through before acceptance.

Security

If you discover a security vulnerability, please follow the process outlined in SECURITY.md rather than opening a public issue.

License

Solid Primitives is released under the MIT License. Copyright © 2021 Solid Core Team.

Each package is independently licensed — see the LICENSE file within any package directory for its specific terms.

Ownership & Governance

Solid Primitives is owned and maintained by the Solid Primitives Working Group — a group of volunteers drawn from the Solid core and ecosystem teams. While not an officially supported product of the Solid Core Team, the working group coordinates directly with core maintainers to ensure primitives remain aligned with the direction of the framework.

Decisions about new packages, stage promotions, and breaking changes are made collaboratively by working group members. To get involved or follow along, join the SolidJS Discord (#solid-primitives channel) or open a discussion in this repository.


Built with ❤️ by the Solid Community

About

A library of high-quality primitives that extend Solid reactivity.

Topics

Resources

Contributing

Security policy

Stars

1.6k stars

Watchers

9 watching

Forks

Releases

Used by

Contributors

Languages