Social feed with a large title, stories, pull-to-refresh and post cards.
npx shadcn@latest add @lokalhost/home-feedAlso installs Avatars, Story Rail.
The source is copied to screens/feed-screen.tsx — it’s yours to edit.
import { FeedScreen, type Post } from "@/screens/feed-screen";
return (
<FeedScreen
posts={posts}
stories={[
{ id: "me", name: "Your story" },
{ id: "a", name: "Amelia Hart" },
{ id: "j", name: "Jonas Berg", seen: true },
]}
onRefresh={async () => {
const res = await fetch("https://api.example.com/feed");
setPosts(await res.json());
}}
onPostPress={(post) => console.log("open", post.id)}
/>
);| Prop | Type | Default | Description |
|---|---|---|---|
postsrequired | Post[] | — | { id, author, avatar?, time, body, image?, likes, comments }. |
stories | Story[] | [] | Renders a StoryRail under the title when non-empty. |
onRefresh | () => Promise<void> | undefined | Enables pull-to-refresh. |
onPostPress | (post: Post) => void | undefined | Post tap handler. |