
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@charisma-ai/react-comic-player
Advanced tools
Charisma.ai React component for playing web stories like an interactive comic.
pnpm i @charisma-ai/react-comic-player
There's a demo app in ./demo/comic
which shows how to integrate the comic player into a React app.
First, integrate @charisma-ai/react
into your React app. Once that's done, you should have at least a playthroughToken
, a conversationUuid
, a Playthrough
component, and a Conversation
component.
Then, the <ComicPlayer>
needs to be linked to the same conversation, so it can display the media for the messages as they arrive.
To do this, render your <ComicPlayer>
inside the same <Playthrough>
and <Conversation>
component, and pass in the same conversation
into <ComicPlayer>
. The best way to do this is to use the useConversationContext
context:
<Playthrough {...playthroughProps}>
<Conversation {conversationProps}>
<MyPlayer />
</Conversation>
</Playthough>
MyPlayer.tsx
const conversation = useConversationContext()
return (
<div style={{ width: 340, height: 600 }}>
<ComicPlayer cconversation={conversation} />
</div>
)
To style the component, import the stylesheet:
import "@charisma-ai/react-comic-player/styles.css";
ComicPlayer
is a responsive component, and fills 100% of the height and width of its parent container. If you wanted a full-screen player, for example, you could set the parent's height and width to 100vh
and 100vw
. Depending on if the comic player is in a portrait or landscape orientation, the ComicPlayer
will only display media layers that are configured for that orientation.
ComicPlayer
is designed to only display the media of the story. To add controls such as tapping or replying, these should be implemented outside the ComicPlayer
. The useConversation
hook or Conversation
component can be used to link the controls to the same conversationUuid
.
FAQs
Charisma.ai React component for web stories
We found that @charisma-ai/react-comic-player demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.