Skip to content
course-kit
Menu

Components

Every component the kit ships, rendered by the kit's own plugin with the starter course's data. What you see here is what a course's build produces.

What you can build

Whole pages from the starter course. Open one to use it at full size.

Building blocks

Props and slots only; they never read the page's data. Use them anywhere.

  • arrow-link A link with a trailing arrow. The label is the slot; href and any other attribute pass through to the <a>.
  • assigned-list A labelled list of readings or deadlines. Renders nothing when empty. Give it the items array, or write the list as a <dl> in the default slot: each <dt> holds the title or its link (give it data-kind and, after the title, <span class="due-chip" data-kind="test">Test</span> for a chip, shown at the end of the row), each <dd> only the check or due detail. The array wins when it has items; when it is missing or empty the slot is rendered instead, so the list still shows if the data does not load.
  • callout A highlighted aside. The content is the slot. A typed callout opens with its type in words, so the type is never told by color alone.
  • card-list A list of cards, each linking to a page. A card shows the page's code, name and description unless the slot supplies its own content. Instead of items you can write the cards yourself as a <ul> of <li> cards in the cards slot (the default slot is taken: it is each card's own content); the array wins when it has items, and when it is missing or empty the cards slot is rendered instead. A card written in the slot must name its overlay link, as the items form does: <li><a href="/x/" aria-labelledby="x-name"></a><h3 id="x-name">Name</h3></li>.
  • codepen-embed A live code sample: a header with actions, then the CodePen embed prefilled with the code.
  • download-button A download link with an icon. The label is the slot. With no file there is no link: a download button that points nowhere is not shown.
  • eyebrow A small line above a heading. The content is the slot.
  • link-list A list of links, each with a name and an optional description. Give it the items array, or write the list in the default slot as a <ul> of links, or as a <dl> (<dt> the link, <dd> the description). The array wins when it has items; when it is missing or empty the slot is rendered instead.
  • link-section A titled list of links. Renders nothing when there are no items and no empty text.
  • meeting-card One class meeting in a week's list: the date down the left, the slot beside it. Marks itself as the scope <today-marker> highlights.
  • meeting-decks A meeting's deck links, each on its own line: the slides, then any addendum. Renders nothing without either.
  • table-rubric A grading rubric as a table: criteria down, performance levels or a due date and points across.
  • today-link The page's Today shortcut: a button that jumps to the #today element <today-marker> picks. Hidden until there is one, and in print.
  • today-marker <today-marker> marks today's class meeting. A host renders it once, adds data-today-host="<name>" to its root, and puts data-date on what it lists; the page's <today-link> jumps to the result. A script flags every [data-date] element listing today's campus date (the site's institution.timezone): data-today, aria-current="date" and a visible "Today" flag (data-today-label overrides the text; a table row gets it in its first cell). One element gets id="today" for the link: today's, else the next meeting, else the first (before the term) or last (after it); never a no-class day. A host puts data-today-scope on the element that should carry the id and the highlight (the schedule's .meeting), otherwise the dated element itself does. An element that already has an id gets an empty <span id="today"> inside it instead, and an existing #today wins.
  • week-block One bordered block per week: a tinted header band, then the slot.

Site sections

Parts of a course site. Most read the course's data files, so they work with no props.

  • book-appointment The one-on-one booking button: a link to instructor.booking.url, labelled by instructor.booking.label or the instructor.bookAnAppointment copy key. Renders nothing when the instructor has no booking. <instructor> places it as the last line of the panel; a page, such as the contact page, can place it anywhere.
  • copyright The copyright line: the build year and the site's author. Reads site.
  • course-documents The "Additional resources" list: the entries of course.documents, each a link with an optional description. A PDF is listed only when the build produced PDFs. Renders nothing when there are none.
  • course-now The home page's opening band: the next class with a link to its week, what is due soon (date first) and the week-by-week progress, side by side as space allows. Hidden until its script has judged "today" in the campus zone. Wording comes from copy.home and copy.schedule.
  • course-summary The course home page's body: the description, the instructor, the syllabus and the schedule. Reads the course, grading, schedule, instructor and term data; it takes no props.
  • demo-weeks The weeks that had a demo, one row per meeting: its demos, then its deck.
  • glossary-entry One glossary term as a <dt>/<dd> pair: the term, its definition, an optional signature, meta line and example, its tags, and where it was taught. Styled by <glossary-panel>, which holds the list.
  • glossary-panel The glossary's element: the grouped list it wraps (the slot), which the script at the foot of this file replaces with Review and Flashcards. One stylesheet covers both, since the script renders the same markup the server does.
  • glossary The course glossary page: every vocab and api slide as one tagged term, listed A to Z and enhanced into Review and Flashcards by <glossary-panel>. Reads the glossary global.
  • grading The grade-weighting table and the grading scale. Reads the grading and scale data; it takes no props and renders nothing without grading.
  • instructor The instructor's details: photo, office, contact and hours, then the booking button (instructor.booking) as the panel's last line when there is one. Reads instructor.
  • masthead The page header: institution, term, course title and the navigation. Reads site, term and course. The menu is Home, Syllabus, then every page of the site menu that has not set menu: false. A page other pages name as their eleventyNavigation.parent is a group: its link, then theirs. When the instructor has a booking link, it is shown under the meeting line on every page, and the menu leaves Contact to the footer.
  • nav-links The site navigation as a list of links, marking the current page. Give it the navigation array, or write the links in the default slot as a <ul> of <li><a>; the array wins when it has items, and when it is missing or empty the slot is rendered instead. A page with children (pages whose eleventyNavigation.parent is its key) is a group: its own link, then its children in a nested list.
  • policies The policies section: one disclosure per entry in policies.json, open by default, each with an optional link to the full policy. Renders nothing without policies.
  • practice-index The practice page's table: every practice sheet in collections.practice, by its worksheet order (then its URL), with what each is for. Says so when there are none. The page's own intro stays page content. Wording comes from copy.practice.
  • schedule-overview The schedule page's header: the meeting line, the key dates, and a sticky row of one jump link per month, with the Hide past weeks toggle at its end. The month on screen is marked as the page scrolls. The row is sticky from 40em wide and static below it, where it would take too much of a phone's height. Props are read in the template, since a setup script cannot see them.
  • schedule-weeks Every week of the term as a bordered block: one row per class meeting (when, topics, and what that class needs: reading, due items, materials) and a footer for the week's own resources. A "This week" card and the Now and Done flags are added by the script, which also works the hide-past toggle that <schedule-overview> puts in its sticky row. Deadlines carry a chip for their kind; the key above the weeks lists the kinds in use. Wording comes from copy.schedule.
  • site-footer The page footer: course, institution, term, copyright and the links. Reads course, site and term. With institution.sourceUrl set it also links to the course's source.
  • slide-timetable Every slide deck as a timetable: one row per week, one column per meeting day.
  • syllabus The syllabus: outcomes, text, technology, coursework and grading, with a contents list of its parts: a row of links above the document on a narrow screen and, from 1100px, a sticky column beside it that marks the part on screen. Reads the course, grading, scale, schedule and project data. The list is built from the parts that render, so a part the course leaves out is not listed.

Practice worksheets

The widgets a practice worksheet is made of.

  • check-controls The Check and Reset buttons and the score line for one worksheet scope. practice.js wires them and fills the tally.
  • choice-list A radio group of lettered choices.
  • cite-panel A "?" disclosure listing the sources for a question.
  • practice-figure A question's inline SVG diagram, written out as authored. Its class vocabulary is styled by the worksheet stylesheet.
  • practice-fill A fill-in question: a word bank and a numbered list of blanks.
  • practice-grid A grid question: rows of choices across columns.
  • practice-judge A judge question: a verdict, then the one line of code that causes the problem.
  • practice-match A match question: a lettered bank and items that each take a letter.
  • practice-question One worksheet question: its prompt, sources, snippet and figure, then the control its kind needs, then the feedback and the reasoning. practice.js grades it.
  • practice-selfcheck A self-check question: reveal the answer, then tick what you got.
  • practice-terms A bank of terms, each opening its definition in a popover.
  • practice-tree A tree question: a snippet and its DOM tree with blanks to fill in.
  • practice-worksheet The practice worksheet page: heading, results summary, question list, sections of questions and the check controls. Reads the worksheet data a worksheet's .11tydata.js supplies; practice.js grades, saves and restores the answers in this browser. With checkMode: "question" (front matter, or worksheets.checkMode in the course config) each gradable question also has a Check answer button; the default, "end", checks only from See results at the end.