FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
lightweight
lightweightglimpse2-runbook-view-glimpse-save-login-react
Remix of lightweight/glimpse2-runbook-view-glimpse-save-login
Public
Like
glimpse2-runbook-view-glimpse-save-login-react
Home
Code
8
_townie
13
backend
7
frontend
5
shared
3
.vtignore
README.md
deno.json
H
main.tsx
Branches
2
Pull requests
Remixes
History
Environment variables
6
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
frontend
/
README.md
Code
/
frontend
/
README.md
Search
9/6/2025
Viewing readonly version of main branch: v8
View latest version
README.md

Frontend

Client-side files that render in the browser.

Glimpse Frontend

The glimpse frontend provides a rich, interactive view of Notion page content with clean, semantic HTML structure.

Files

  • glimpse.html - HTML template with React mount point and custom CSS
  • glimpse.tsx - React entry point that bootstraps the application
  • components/GlimpseView.tsx - Main component that handles data fetching and layout
  • components/NotionProperty.tsx - Renders Notion page properties with proper formatting
  • components/NotionBlock.tsx - Recursively renders Notion blocks with semantic HTML
  • components/NotionBlocks.tsx - Helper component for grouping blocks (especially lists)

Features

  • Content Negotiation: /glimpse/:id serves HTML for browsers, JSON for API calls
  • Server-Side Data Injection: Initial data injected to avoid loading states
  • Semantic HTML Structure: Clean HTML without unnecessary wrapper divs
  • Smart List Handling: Proper <ul>/<ol> grouping for consecutive list items
  • Rich Notion Rendering: Supports headings, paragraphs, lists, code blocks, callouts, etc.
  • Property Display: Shows all page properties with type-specific formatting
  • Error Handling: Graceful error states with retry functionality
  • Responsive Design: Mobile-friendly layout using TailwindCSS
  • Debug Mode: Raw data view in development environments

HTML Structure Improvements

Smart Wrapper Strategy

  • No Wrappers: Simple elements like <p>, <h1>-<h6>, <blockquote> render directly
  • Conditional Wrappers: Complex blocks like callouts, toggles get wrapper divs only when needed
  • Semantic Lists: Consecutive list items are grouped into proper <ul>/<ol> containers
  • Valid HTML: Maintains proper parent-child relationships (no <div> around <li>)

Block Categories

  1. Simple Blocks (no wrapper): paragraphs, headings, quotes, dividers, code blocks
  2. List Items (grouped): bulleted and numbered list items grouped into semantic lists
  3. Complex Blocks (wrapper needed): callouts, toggles, file attachments, embeds
  4. Media Blocks (conditional wrapper): images and videos get wrappers only if captions exist
  5. Container Blocks: tables, columns maintain proper semantic structure

Usage

  1. Browser Access: Visit /glimpse/:id in browser to see rich HTML view
  2. API Access: Use /api/demo/:id endpoint for raw JSON data
  3. Fallback: If HTML template fails to load, shows informative error page

Supported Notion Block Types

  • Text blocks: paragraph, headings (1-3), rich text formatting
  • Lists: bulleted, numbered, to-do items (properly grouped)
  • Interactive: toggle blocks, callouts, checkboxes
  • Media: images, videos, files, bookmarks, embeds
  • Structure: dividers, columns, tables
  • Code: inline code and code blocks with syntax highlighting

Styling

Uses a combination of:

  • TailwindCSS: Via CDN for utility classes
  • Custom CSS: Notion-specific styling in glimpse.html
  • Semantic Classes: Clean class names like notion-heading-1, notion-callout
  • Responsive Design: Mobile-first approach

Technical Benefits

  • Better Accessibility: Proper HTML semantics for screen readers
  • Cleaner CSS: Simpler selectors without unnecessary wrapper divs
  • Valid HTML: Maintains proper element relationships
  • Performance: Fewer DOM nodes, better rendering performance
  • SEO Friendly: Semantic HTML structure for search engines
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.