Ordered -columnar structures found in covalent organic frameworks (COFs) render them attractive as smart materials. However, external-stimuli-responsive COFs have not been explored. Here we report the design and synthesis of a photoresponsive COF with anthracene units as the photoresponsive -building blocks. The COF is switchable upon photoirradiation to yield a concavo-convex polygon skeleton through the interlayer [4+4] cycloaddition of anthracene units stacked in the -columns. This cycloaddition reaction is thermally reversible; heating resets the anthracene layers and regenerates the COF. These external-stimuli-induced structural transformations are accompanied by profound changes in properties, including gas adsorption, -electronic function, and luminescence. The results suggest that COFs are useful for designing smart porous materials with properties that are controllable by external stimuli.