Packages
@teactjs/ui
The component layer — Message, keyboards, media, polls, formatting, layout, and the re-exported data hooks.
@teactjs/ui is where every Teact component lives. Import your UI from here; the engine and hooks
come from @teactjs/core. Components render through the core reconciler, so
the two packages are always used together.
bun add @teactjs/uiimport { Message, InlineKeyboard, ButtonRow, Button } from "@teactjs/ui";Components
- Messaging:
Message,Notification,Alert - Inline keyboards:
InlineKeyboard,ButtonRow,Button,WebAppButton - Reply keyboards:
ReplyKeyboard,ReplyRow,ReplyButton,RequestContactButton,RequestLocationButton,ReplyKeyboardRemove - Media:
Photo,Document,Video,Animation,Voice,Audio,VideoNote,Sticker,MediaGroup,MediaPhoto,MediaVideo - Rich data:
Poll,Contact,Location,LiveLocation,Venue - Formatting:
Bold,Italic,Code - Layout:
List,ListItem,Divider - Resilience:
ErrorBoundary,SuspenseFallback
Data hooks
useQuery and useMutation are re-exported from @teactjs/core for convenience, so you can pull
components and data hooks from one import:
import { Message, useQuery } from "@teactjs/ui";Example
import { Message, InlineKeyboard, Button } from "@teactjs/ui";
import { useState } from "@teactjs/core";
function Counter() {
const [count, setCount] = useState(0);
return (
<Message text={`Count: ${count}`}>
<InlineKeyboard>
<Button text="-1" onClick={() => setCount((c) => c - 1)} />
<Button text="+1" onClick={() => setCount((c) => c + 1)} />
</InlineKeyboard>
</Message>
);
}A bare <Button> becomes its own row. Use <InlineKeyboard columns={2}> to auto-grid buttons into
N-column rows, or wrap buttons in <ButtonRow> for one explicit row.
See the Components guide for per-component props and layout rules.