Dynamic content feed components for displaying University of Maryland news, events, and academic information with automatic updates, caching, and brand-compliant styling.
The UMD Feeds Library simplifies the integration of dynamic UMD content into any web application. It provides pre-built components for displaying news articles, event calendars, and academic program information that automatically sync with UMD data sources. Built on the Elements Library and styled with the Styles Library, these components ensure consistent presentation while handling all complexities of data fetching, caching, error handling, and responsive layouts.
# Using npm
npm install @universityofmaryland/web-feeds-library
# Using yarn
yarn add @universityofmaryland/web-feeds-library
For complete styling and functionality:
npm install @universityofmaryland/web-styles-library
npm install @universityofmaryland/web-elements-library
import { news, events } from '@universityofmaryland/web-feeds-library';
// Create a news grid
const newsGrid = news.grid({
token: 'your-api-token',
numberOfColumnsToShow: 3,
isThemeDark: false,
});
// Add to your page
document.querySelector('.news-container').appendChild(newsGrid.element);
Display UMD news articles in various layouts:
import { news } from '@universityofmaryland/web-feeds-library';
// Grid layout - Responsive card grid
const newsGrid = news.grid({
token: 'your-api-token',
numberOfColumnsToShow: 3,
isThemeDark: false,
isTransparent: false,
});
// List layout - Vertical article list
const newsList = news.list({
token: 'your-api-token',
});
// Featured layout - Hero article with sidebar
const newsFeatured = news.featured({
token: 'your-api-token',
isLazyLoad: true,
isLayoutReversed: false,
});
Display UMD events with calendar integration:
import { events } from '@universityofmaryland/web-feeds-library';
// Grid layout - Event cards
const eventsGrid = events.grid({
token: 'your-api-token',
numberOfColumnsToShow: 3,
});
// List layout - Chronological list
const eventsList = events.list({
token: 'your-api-token',
});
// Slider - Horizontal scroll
const eventsSlider = events.slider({
token: 'your-api-token',
});
Display academic programs and information:
import { academic } from '@universityofmaryland/web-feeds-library';
// Academic event slider
const academicSlider = academic.slider({
token: 'your-api-token',
department: 'engineering',
programType: 'graduate',
});
Feeds automatically use UMD styles for consistent appearance:
<!-- Feeds inherit grid and spacing utilities -->
<div class="umd-layout-space-vertical-landing">
<div id="news-feed"></div>
</div>
Feeds are built using Elements for rendering:
Feeds can be wrapped in web components:
import { Components } from '@universityofmaryland/web-components-library';
import { news } from '@universityofmaryland/web-feeds-library';
// Initialize feed component wrapper
Components.feed.newsList();
// Feed will render inside the component
All feeds accept these base properties:
interface BaseFeedProps {
token: string; // Required: API authentication token
isThemeDark?: boolean; // Dark theme styling
isTransparent?: boolean; // Transparent card backgrounds
}
Grid Layout:
interface GridProps extends BaseFeedProps {
numberOfColumnsToShow?: number; // 1-4, default: 3
}
Featured Layout:
interface FeaturedProps extends BaseFeedProps {
isLazyLoad?: boolean;
isLayoutReversed?: boolean;
}
import { events } from '@universityofmaryland/web-feeds-library';
const eventsFeed = events.list({
token: 'your-api-token',
onLoad: (items) => {
console.log(`Loaded ${items.length} events`);
},
onError: (error) => {
console.error('Feed error:', error);
// Show fallback content
},
onItemClick: (item) => {
// Custom click handler
console.log('Clicked:', item.title);
},
});
// Listen for feed updates
eventsFeed.element.addEventListener('feed:update', (e) => {
console.log('Feed updated with new items');
});
Load content as users scroll:
const lazyFeed = news.featured({
token: 'your-api-token',
isLazyLoad: true,
});
Full TypeScript definitions included:
import type {
NewsFeedProps,
EventsFeedProps,
FeedItem,
FeedEvents,
} from '@universityofmaryland/web-feeds-library';
const newsProps: NewsFeedProps = {
token: 'token',
numberOfColumnsToShow: 3,
isThemeDark: false,
};
All feed components are WCAG 2.1 AA compliant:
# Run tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverage
See the main repository for contribution guidelines.
University of Maryland