feat(ListView): add ListViewSkeleton component#3330
feat(ListView): add ListViewSkeleton component#3330rzp-slash[bot] wants to merge 5 commits intomasterfrom
Conversation
Adds `ListViewSkeleton` — a shimmer placeholder that mirrors the full
ListView layout so every list view has a consistent, first-class loading
state without needing spinners or ad-hoc skeletons.
Layout mirrors:
1. QuickFilter tab pills (4 pill-shaped skeletons)
2. Search / action area (rectangular skeleton, right-aligned)
3. Table header row (one skeleton per column)
4. Table body rows (configurable via `rows` prop, cell widths
vary to look like real data)
5. Pagination bar (3 skeletons, bottom-right)
API:
rows — body row count (default: 7)
columns — column count (default: 5)
showFilters — toggle filter bar skeleton (default: true)
showPagination — toggle pagination skeleton (default: true)
Usage:
if (isLoading) return <ListViewSkeleton rows={7} columns={5} />;
return <ListView>...</ListView>;
Changes:
- packages/blade/src/components/ListView/ListViewSkeleton.tsx (new)
- packages/blade/src/components/ListView/__tests__/ListViewSkeleton.web.test.tsx (new, 13 tests + 2 snapshots)
- packages/blade/src/components/ListView/index.ts (export ListViewSkeleton)
- packages/blade/src/components/ListView/docs/ListView.stories.tsx (4 new stories)
No new dependencies. Built on existing Skeleton + Box primitives.
export * from './ListView' in components/index.ts already covers this.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
✅ PR title follows Conventional Commits specification. |
- Remove unused @ts-expect-error directives (gridTemplateColumns is properly typed in Box) - Replace getCellWidth returning plain string with CELL_WIDTHS constants typed as SpacingValueType - Replace template literal widths for filter tabs with FILTER_TAB_WIDTHS array typed as SpacingValueType[] - Import SpacingValueType from Box/BaseBox/types/spacingTypes for proper type constraints Co-authored-by: abhinavkrishnaaa <abhinav.krishna@razorpay.com>
|
Box only supports display "flex"|"none". Replace the grid layout on the header and row containers with a styled(BaseBox) component that uses CSS grid via styled-components — matching the pattern used by Table internals. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 7066a0c:
|
Co-authored-by: abhinavkrishnaaa <abhinav.krishna@razorpay.com>
🛡️ Coverage ReportSummaryFull Coverage Details |
…ically
Add `columns` to ListViewContext and ListViewProps so that
<ListViewSkeleton> placed inside <ListView columns={N}> automatically
renders the same number of columns as the table — no manual sync needed.
The explicit `columns` prop on ListViewSkeleton is kept as a fallback
for standalone usage outside a ListView wrapper.
Recommended pattern:
<ListView columns={4}>
{isLoading ? <ListViewSkeleton /> : <><ListViewFilters /><Table /></>}
</ListView>
Co-authored-by: abhinavkrishnaaa <abhinav.krishna@razorpay.com>
Summary
Adds
ListViewSkeleton— a shimmer placeholder that mirrors the fullListViewlayout so every list view has a consistent, first-class loading state without needing spinners or ad-hoc custom skeletons.Discussed in the Blade Slack thread — agreed to implement standard skeleton loading for list views, without RazorSense animation (tried but looked odd).
What it renders
70% / 75% / 50%) to look like real dataAPI
Usage
Files changed
src/components/ListView/ListViewSkeleton.tsxsrc/components/ListView/__tests__/ListViewSkeleton.web.test.tsxsrc/components/ListView/index.tsListViewSkeleton+ListViewSkeletonPropssrc/components/ListView/docs/ListView.stories.tsxexport * from './ListView'incomponents/index.tsalready covers the new export — no separate change needed there.Test coverage
rowsprop renders correct count (tested: 1, 3, 5, 7)showFilterstoggles filter barshowPaginationtoggles pagination barNotes
Skeleton+BoxprimitivestestIDon every structural section for easy product-side test targetingStorybook preview
Chromatic will generate a preview link once CI passes. Stories to look for:
Patterns/ListView — Skeleton — DefaultPatterns/ListView — Skeleton — Table OnlyPatterns/ListView — Skeleton — Many Columns (6)Patterns/ListView — Skeleton → ListView transition (reload to replay)🤖 Generated with Claude Code