npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-pageloom

v0.1.5

Published

Unique React component library designed for seamless construction of single-page applications.

Downloads

24

Readme

React PageLoom is a powerful and flexible library for creating stunning, interactive web page layouts with React.js. It provides a component-based system for building application interfaces, offering a unique and seamless way to enhance the user experience through dynamic navigation and visually appealing elements.

Each section, or "block", spans the entire viewport, effectively filling 100% of the screen's width and height. This approach simplifies the construction of immersive, one-page experiences where content is presented in distinct, full-screen sections that users can navigate through vertically.

Documentation

You can see an example of a web page created using React PageLoom and full documentation of the package here.

Example and Usage

Check out the live demo to see the result.

The following code creates a simple web page with a header, two blocks, and a footer. The navigation bar is automatically generated based on the blocks and their labels.

import {
	Container,
	HeaderLogo,
	PageBlock,
	PageFooter,
	PageHeader,
	PageWrapper,
} from 'react-pageloom';

function App() {
	return (
		<PageWrapper
			sx={{
				fontFamily: 'Montserrat',
			}}
		>
			<PageHeader>
				<HeaderLogo>PageLoom Example</HeaderLogo>
				<Container>
					This is <code>PageHeader</code> with <code>Container</code>
				</Container>
			</PageHeader>
			<PageBlock id="block-1" label="PageBlock 1">
				<Container>
					<h1>
						This is <code>PageBlock</code> with <code>Container</code>
					</h1>
				</Container>
			</PageBlock>
			<PageBlock
				id="block-2"
				label="PageBlock 2"
				sx={{
					backgroundColor: 'lightblue',
				}}
			>
				<h1>
					This is <code>PageBlock</code> without <code>Container</code>
				</h1>
			</PageBlock>
			<PageFooter>
				<h1>
					This is the footer with <code>PageFooter</code>
				</h1>
			</PageFooter>
		</PageWrapper>
	);
}

export default App;

What do you get?

Build the application by utilizing the following components: PageHeader, PageBlock, and PageFooter. The navigation component will be added automatically. You can style each component using the sx prop or by using the custom classes that are added to each component. For all the classes check the documentation page.

Installation

If you use npm:

npm install react-pageloom

If you use yarn:

yarn add react-pageloom

Features

  • Component-based: Create layouts using various building blocks like HeaderLogo, PageBlock, PageHeader, PageWrapper, and Container.
  • Smooth navigation: Integrated with react-scroll for an effortless scrolling experience.
  • Scroll locking: Automatically focus on one block at a time while scrolling.
  • Dynamic navigation bar: Navigation is automatically updated based on the currently active block and block components.
  • Customization: Each component supports the sx prop for easy styling and has custom classes that you can style with CSS. For all the classes check the documentation page.

Components

  • PageWrapper: The outermost wrapper for your page.
  • PageHeader: A special block that sits at the top of your page. Think of it as a Hero Page.
  • HeaderLogo: Add to PageHeader to update the Logo for navbar.
  • PageBlock: Use it to create distinct sections on your page. Each block occupies at least the height of your viewport.
  • Container: An optional component that can be used inside blocks for centering content and maintaining a fixed width.

Global Theme

React PageLoom offers a global theme that can be used to customize the appearance of the entire web page. The theme can be customized by passing a theme object to the PageWrapper component. Check out the documentation page for more information.

const myTheme = {
	// Example theme object
	colors: {
		text: '#243c5a', // Deep Sea Blue
		background: '#f9f871', // Sun Glow
		primary: '#e84a5f', // Flamenco Red
		secondary: '#ff8474', // Salmon Pink
		navBackground: '#2a363b', // Swell Gray
		navText: '#fecea8', // Peach Orange
		activeLink: '#fe8a71', // Bittersweet
		hoverLink: '#e84a5f', // Flamenco Red
		mobileMenuBackground: '#2a363b', // Swell Gray
	},
};

<PageWrapper theme={myTheme}>...</PageWrapper>;

Light and Dark Mode (and more)

With the theme object, you can also customize the appearance of the page based on the user's preferences. Multiple themes can be defined and switched between using the theme prop of the PageWrapper component. Check out the documentation page for more information or see the example below.

export const useTheme = (themeMode: ThemeProps) => {
	switch (themeMode) {
		case 'light':
			return lightTheme;
		case 'dark':
			return darkTheme;
		case 'retro':
			return retroTheme;
		case 'pastel':
			return pastelTheme;
		default:
			return lightTheme;
	}
};

	const [currentTheme, setCurrentTheme] = useState<ThemeProps>('light');
	const theme = useTheme(themeName);

	return (
		<PageWrapper
			fixedNav
			drawerNav
			theme={currentTheme}
			// You can add extra components to the navigation bar like this
			extraNavComponent={
				<StyledSelect
					name="theme"
					onChange={(event) => setCurrentTheme(event.target.value as ThemeProps)}
				>
					<option value="light">Light</option>
					<option value="dark">Dark</option>
					<option value="retro">Rainbow</option>
					<option value="pastel">Pastel</option>
				</StyledSelect>
			}
		>
		...

Contributing

We appreciate all contributions. To contribute, please fork the repository and create a new branch for each feature or bugfix. Then, submit a pull request with a detailed description of your changes.

License

React PageLoom is MIT licensed.

For more information, please visit our documentation.