MCPcopy
hub / github.com/wandb/openui / Examples

Function Examples

frontend/src/components/Examples.tsx:4–102  ·  view source on GitHub ↗
({
	className,
	style,
	callback
}: {
	className?: string
	style?: React.CSSProperties
	callback: (prompt: string) => void
})

Source from the content-addressed store, hash-verified

2import { cn } from '../lib/utils'
3
4export default function Examples({
5 className,
6 style,
7 callback
8}: {
9 className?: string
10 style?: React.CSSProperties
11 callback: (prompt: string) => void
12}) {
13 const examples = [
14 // 'Make me a flashy landing page for an AI SaaS startup. Use some gradients and animations on hover. Come up with an exciting name and create a navigation bar up top.',
15 'Create a responsive navigation bar with dropdown menus, using a dark theme.',
16 'I need a user profile card with an avatar, name, and social media links in Tailwind CSS.',
17 'Generate a modal popup for user feedback, including text area and submit button.',
18 'Can you make a pricing table with three tiers, highlighting the best value tier?',
19 'Build a responsive image gallery grid that supports lightbox viewing.',
20 "I'm looking for a login form with email and password fields, plus a remember me checkbox.",
21 'Design a newsletter signup section with an input field and a subscribe button, featuring a minimalist aesthetic.',
22 'Create a footer with columns for links, a brief about section, and social media icons.',
23 'Generate a dashboard layout with a sidebar navigation, header, and content area.',
24 'I need an accordion FAQ section where questions expand to show answers on click.',
25 'Produce a blog post template with a featured image, title, date, author, and content area.',
26 'Design a to-do list app interface with tasks, checkboxes, and an add task form.',
27 'Create a progress bar component that shows percentage completion and can be styled dynamically.',
28 'Generate a contact form with name, email, message fields, and a send button, with validation styles.',
29 'Design a carousel slider for featured articles with previous and next controls, using a sleek, modern look.',
30 'Create a set of social share buttons with icons for Facebook, Twitter, LinkedIn, and Instagram, with a hover effect.',
31 'Generate a responsive table with sortable columns, row highlight on hover, and pagination.',
32 "I need a card layout for product listings, including an image, title, price, and 'Add to Cart' button.",
33 "Build a timeline component for displaying a project's milestones, with vertical lines and circular markers.",
34 'Design a weather widget showing the current temperature, weather condition icons, and a 5-day forecast.',
35 'Create an alert component with success, warning, and error variations that can be dismissed.',
36 'Generate a multi-step form for a checkout process, including progress indicators.',
37 "I'm looking for a tab component with horizontal navigation and dynamically loaded content.",
38 'Design a search bar with autocomplete suggestions that appear as the user types.',
39 'Create a sticky header that becomes visible when scrolling up and hides on scrolling down.',
40 'Generate a set of animated loading spinners with different styles for asynchronous data loading.',
41 'I need a grid of cards for team members, including photo, name, role, and a short bio, with a flip effect on hover.',
42 'Build a testimonial slider with quotes from customers, including their names and photos.',
43 'Design a date picker component that integrates with a form and supports range selection.',
44 'Generate a set of badges for different status levels like New, In Progress, and Completed, with customizable colors.'
45 ]
46 const [ids, setIds] = useState<number[]>([])
47
48 useEffect(() => {
49 const uniqRandIDs = new Set<number>()
50 while (uniqRandIDs.size < 3) {
51 uniqRandIDs.add(Math.floor(Math.random() * examples.length))
52 }
53 setIds([...uniqRandIDs])
54 }, [examples.length])
55
56 return (
57 <div
58 className={cn(
59 className,
60 'flex flex-wrap items-center justify-center gap-2 transition-all duration-500'
61 )}

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
callbackFunction · 0.85

Tested by

no test coverage detected