space-header
/
1.0.0
space-header 1.0.0
Install from the command line:
Learn more about npm packages
$ npm install @huggingface/space-header@1.0.0
Install via package.json:
"@huggingface/space-header": "1.0.0"
About this version
A Typescript powered wrapper for the Space mini_header
feature.
pnpm add @huggingface/space-header
npm add @huggingface/space-header
yarn add @huggingface/space-header
// esm.sh
import { init } from "https://esm.sh/@huggingface/space-header"
// or npm:
import { init } from "npm:@huggingface/space-header"
import { init } from "@huggingface/space-header";
// ...
init(":user/:spaceId");
// init("enzostvs/lora-studio") for example
❗Important note: The init
method must be called on the client side.
Uses the target
option to inject the space-header into another DOM element
const app = document.getElementById("app");
// ...
init(":user/:spaceId", {
target: app
});
If you already have the space data, you can also pass it as a parameter to avoid a fetch
init(space);
// space = {
// id: string;
// likes: number;
// author: string;
// }
Details
- space-header
- huggingface
- 5 months ago
- ISC
- 2 dependencies
Assets
- space-header-1.0.0.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0