Skip to content

Solid Primitives

Bindings for the community packages published under @solid-primitives. Each page lists the bound signatures; for usage, read the upstream documentation, which the bindings follow closely. The signatures are the 2.x packages', so their DOM types (HtmlElement, Event) come from Fable.Browser.Dom; a Solid 2 port will use Xantham's Dom.X types.

Some pages show the primitive's behaviour live, written in plain Partas.Solid 3.0. That code works today, so you can use it until the package is ported.

Packages

PagePackage
Active Element@solid-primitives/active-element
Autofocus@solid-primitives/autofocus
Bounds@solid-primitives/bounds
Broadcast Channel@solid-primitives/broadcast-channel
Clipboard@solid-primitives/clipboard
Devices@solid-primitives/devices
Event Bus@solid-primitives/event-bus
Event Listener@solid-primitives/event-listener
Idle@solid-primitives/idle
Input Mask@solid-primitives/input-mask
JSX Tokenizer@solid-primitives/jsx-tokenizer
Keyboard@solid-primitives/keyboard
Media@solid-primitives/media
Mouse@solid-primitives/mouse
Permission@solid-primitives/permission
RAF@solid-primitives/raf
Rootless@solid-primitives/rootless
Scheduled@solid-primitives/scheduled
Scroll@solid-primitives/scroll
Spring@solid-primitives/spring
Storage@solid-primitives/storage
Timer@solid-primitives/timer
Trigger@solid-primitives/trigger
Tween@solid-primitives/tween
WebSocket@solid-primitives/websocket (not bound)

Packages and namespaces

Each primitive is its own NuGet package, such as Partas.Solid.Primitives.Mouse. All of them share the namespace Partas.Solid.Primitives and depend on Partas.Solid.Primitives.Common. Femto installs a package together with its npm dependency:

femto install Partas.Solid.Primitives.Mouse

Use, make and create

The bindings keep the @solid-primitives naming scheme:

  • make primitives are not reactive, but they clean up their resources when their owner is disposed.
  • use primitives are usually rootless: one instance, shared by every consumer.
  • create primitives are reactive, and clean up their resources when their owner is disposed.

Some primitives return a DisposeCallback, a unit -> unit from Partas.Solid.Primitives.Common. Call it to release the resource before its owner is disposed. (Core Partas.Solid 3.0 calls the same shape DisposalFunc.)

Edit this page