1.9.0 • Published 1 year ago
clef-ui-sdk v1.9.0
Clef UI SDK
ClefDisc component and function lib for song playback control
npm i clef-ui-sdk
ClefDisc
Minimal example:
import { ClefDisc } from 'clef-ui-sdk';
const Foo = () => <ClefDisc assetID={ASSET_ID} />;
Full example:
import { ClefDisc } from 'clef-ui-sdk';
const Foo = () => {
const handleImageReady = (image: string) => console.log(image);
return <ClefDisc assetID={ASSET_ID} isAnimate borderColor="#ffffff" onImageReady={handleImageReady} />;
}
- assetID - asset identifier
- isAnimate - enable rotation (optional)
- borderColor - disc border color (optional, no border by default)
- colors - pass array of COLORS or get colors from asset if
null
orundefined
(optional,null
by default) - size -
small-responsive
: 28px - 34px,normal-responsive
: 92px - 240px (normal-responsive
by default) - onImageReady - callback, if passed, returns the base64 png image in the
image
parameter (optional, not converted by default)
type Props = {
assetID: string;
isAnimate?: boolean;
borderColor?: string;
colors?: SongColor[] | null;
size?: 'small-responsive' | 'normal-responsive';
onImageReady?: (image: string) => void;
};
SDK
Providing functions from SDK:
Function play_song_by_asset_id
partially applied.
No first argument Tone
- get_song_name_by_asset_id
- set_volume
- play_song_by_asset_id
- stop
import { get_song_name_by_asset_id } from 'clef-ui-sdk';
1.9.0
1 year ago
1.8.2
1 year ago
1.8.1
1 year ago
1.8.0
1 year ago
1.8.4
1 year ago
1.8.3
1 year ago
1.7.1
1 year ago
1.7.0
1 year ago
1.6.2
1 year ago
1.6.1
1 year ago
1.6.0
1 year ago
1.5.1
1 year ago
1.5.0
1 year ago
1.4.1
1 year ago
1.3.2
1 year ago
1.4.0
1 year ago
1.3.1
1 year ago
1.3.0
1 year ago
1.2.3
1 year ago
1.2.2
1 year ago
1.2.1
1 year ago
1.2.0
1 year ago
1.1.3
1 year ago
1.1.2
1 year ago
1.1.1
1 year ago
1.1.0
1 year ago
1.0.1
1 year ago
1.0.0
1 year ago