Skip to content

Enhance playground examples to demonstrate complete component library#170

Merged
hotlong merged 2 commits intomainfrom
copilot/improve-playground-examples
Jan 23, 2026
Merged

Enhance playground examples to demonstrate complete component library#170
hotlong merged 2 commits intomainfrom
copilot/improve-playground-examples

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 23, 2026

Playground examples were minimal and didn't showcase ObjectUI's full capabilities. Users couldn't see how components work together or understand real-world usage patterns.

Changes

Enhanced Form Example

  • Multi-column layout with proper labels
  • Select dropdown, separator, newsletter checkbox
  • Primary + secondary button pattern

Enhanced Dashboard Example

  • 4 stat cards with icons and trend indicators (was 3 basic cards)
  • Recent Activity section with avatars and badges
  • Top Products section with categorized items
  • 4-column and 2-column grid layouts

New Data Table Example

  • User management table with 5 columns
  • Pagination controls and result counters
  • Hoverable and striped row styling

New E-commerce Example

  • Product cards with star ratings, pricing, and badges
  • Gradient backgrounds for product categories
  • Filter and Sort actions

Navigation

  • Descriptive labels: "Data Table", "E-commerce" (was "dataTable", "ecommerce")

Impact

  • Component coverage: 8 → 15+ types
  • Examples demonstrate: label, select, separator, icon, badge, avatar, table, pagination
  • Real-world patterns: contact forms, analytics dashboards, data management, product showcases

Example of enhanced schema structure:

{
  type: "card",
  children: [{
    type: "grid",
    columns: 4,
    children: [
      {
        type: "card",
        children: [
          { type: "icon", name: "DollarSign" },
          { type: "text", content: "$45,231.89", className: "text-2xl font-bold" },
          { type: "text", content: "+20.1%", className: "text-green-600" }
        ]
      }
      // ... 3 more stat cards
    ]
  }]
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/objectui/objectui/apps/site/node_modules/.bin/../next/dist/bin/next build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

playground 几个例子都做得精致一点,能够体现完整的功能


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 23, 2026

Deployment failed with the following error:

Resource is limited - try again in 10 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/xuyushun441-sys-projects?upgradeToPro=build-rate-limit

- Enhanced Form example: Added proper labels, multi-column layout, select dropdown, separator, newsletter checkbox, and better styling
- Enhanced Dashboard example: Added 4 statistics cards with icons and trend indicators, Recent Activity section with avatars and badges, Top Products section with categorized items
- Added new Data Table example: User management table with proper columns, status indicators, and pagination
- Added new E-commerce example: Product cards with images (icon placeholders), ratings, pricing, badges, and add-to-cart functionality
- Improved example button labels for better clarity
- All examples now demonstrate ObjectUI's complete capabilities including icons, badges, avatars, cards, grids, and proper component composition

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Jan 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
objectui-site Ready Ready Preview, Comment Jan 23, 2026 4:58pm

Request Review

Copilot AI changed the title [WIP] Enhance playground examples for complete functionality Enhance playground examples to demonstrate complete component library Jan 23, 2026
Copilot AI requested a review from hotlong January 23, 2026 17:02
@hotlong hotlong marked this pull request as ready for review January 23, 2026 18:01
Copilot AI review requested due to automatic review settings January 23, 2026 18:01
@hotlong hotlong merged commit e868edf into main Jan 23, 2026
6 of 7 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the playground examples to better demonstrate ObjectUI's component library capabilities. The changes transform minimal examples into comprehensive, real-world UI patterns that showcase the library's features.

Changes:

  • Enhanced form example with multi-column layout, labels, select dropdown, separator, and multiple button patterns
  • Expanded dashboard example from 3 to 4 stat cards with icons and trend indicators, plus new "Recent Activity" and "Top Products" sections
  • Added new Data Table example demonstrating user management with pagination
  • Added new E-commerce example showing product cards with ratings, pricing, and badges
  • Improved example navigation labels for better clarity

Comment on lines +243 to +244
label: "Download Report",
icon: "Download"
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The icon prop on buttons is not currently supported by the button renderer implementation. The ButtonSchema type definition includes this property, but the button renderer in packages/components/src/renderers/form/button.tsx does not render icons. This will result in the icon being ignored when this schema is rendered.

To fix this, the button renderer needs to be updated to import and render Lucide icons based on the icon and iconPosition schema properties.

Suggested change
label: "Download Report",
icon: "Download"
label: "Download Report"

Copilot uses AI. Check for mistakes.
Comment on lines +90 to +92
type: "label",
htmlFor: "firstName",
label: "First Name"
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The htmlFor attribute is specified in the label schema but the label renderer in packages/components/src/renderers/form/label.tsx does not pass this attribute to the underlying Label component. This breaks the association between labels and their corresponding form inputs, which is critical for accessibility.

The label renderer should be updated to pass schema.htmlFor as the htmlFor prop to the Label component.

Copilot uses AI. Check for mistakes.
Comment on lines +803 to +805
],
hoverable: true,
striped: true
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hoverable and striped properties are defined in the TableSchema type but are not implemented in the table renderer at packages/components/src/renderers/complex/table.tsx. These properties will be ignored when the schema is rendered, resulting in tables that don't have the expected visual styling.

The table renderer should be updated to conditionally apply hover and striped row classes based on these schema properties.

Suggested change
],
hoverable: true,
striped: true
]

Copilot uses AI. Check for mistakes.
Comment on lines +767 to +803
data: [
{
user: "John Doe",
email: "john@example.com",
role: "Admin",
status: "Active",
actions: "•••"
},
{
user: "Jane Smith",
email: "jane@example.com",
role: "Editor",
status: "Active",
actions: "•••"
},
{
user: "Bob Johnson",
email: "bob@example.com",
role: "Viewer",
status: "Inactive",
actions: "•••"
},
{
user: "Alice Williams",
email: "alice@example.com",
role: "Editor",
status: "Active",
actions: "•••"
},
{
user: "Charlie Brown",
email: "charlie@example.com",
role: "Viewer",
status: "Active",
actions: "•••"
}
],
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to ObjectUI's architectural guidelines (Rule #1: Protocol Agnostic), hardcoded data in schemas should be avoided in favor of data binding patterns. This example contains extensive hardcoded table data (user information, emails, roles, etc.) directly in the JSON schema.

While this is acceptable for a playground example to demonstrate functionality, consider adding a comment or documentation noting that in production, this data should be fetched via the DataSource interface pattern (e.g., using bind properties or data adapters) rather than being hardcoded in the schema.

Copilot generated this review using guidance from repository custom instructions.
Copilot AI review requested due to automatic review settings March 23, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants