Skip to main content
Home

Built and signed on GitHub Actions

Works with
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score64%
Publisheda year ago (0.0.6)
function liftSolid
liftSolid<
TAttributes extends Attributes,
Options extends LiftOptions<TAttributes>,
>
(
tagName: string,
opts: Partial<LiftOptions<TAttributes>>,
): LiftBaseConstructor<TAttributes, Options>

Creates a custom element. The init function is called when the element is connected to the DOM, and you can safely use Solid's reactive primitives like createEffect and onCleanup and createSignal inside it.

Examples

Example 1

// rendered with <hello-el name="world"></hello-el>
import { liftSolid, useAttributes } from "@lift-html/solid";
import { createEffect } from "solid-js";

liftSolid("hello-el", {
  observedAttributes: ["name"],
  init() {
    const props = useAttributes(this);
    createEffect(() => {
      this.innerText = "Hello, " + props.name;
    });
  },
});

Type Parameters

TAttributes extends Attributes
Options extends LiftOptions<TAttributes>

Parameters

tagName: string
opts: Partial<LiftOptions<TAttributes>>

Return Type

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@lift-html/solid

Import symbol

import { liftSolid } from "@lift-html/solid";
or

Import directly with a jsr specifier

import { liftSolid } from "jsr:@lift-html/solid";

Add Package

pnpm i jsr:@lift-html/solid
or (using pnpm 10.8 or older)
pnpm dlx jsr add @lift-html/solid

Import symbol

import { liftSolid } from "@lift-html/solid";

Add Package

yarn add jsr:@lift-html/solid
or (using Yarn 4.8 or older)
yarn dlx jsr add @lift-html/solid

Import symbol

import { liftSolid } from "@lift-html/solid";

Add Package

vlt install jsr:@lift-html/solid

Import symbol

import { liftSolid } from "@lift-html/solid";

Add Package

npx jsr add @lift-html/solid

Import symbol

import { liftSolid } from "@lift-html/solid";

Add Package

bunx jsr add @lift-html/solid

Import symbol

import { liftSolid } from "@lift-html/solid";